{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# TikzGraphs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This library uses the LaTeX package [pgf/tikz](http://www.ctan.org/pkg/pgf) to produce graphs. It integrates with IJulia, outputting SVG images to the notebook."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Installation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "Pkg.add(\"TikzGraphs\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In addition, you will need to install the following dependencies if you do not already have them on your system.\n",
    "* Pdf2svg. This is required by TikzPictures. On Ubuntu, you can get this by running `sudo apt-get install pdf2svg`. On Windows, you can download the binaries from http://www.cityinthesky.co.uk/opensource/pdf2svg/. Be sure to add pdf2svg to your path (and restart).\n",
    "* Pgf (version 3.0 or later). Install using your latex package manager (e.g., texlive or miktex).\n",
    "\n",
    "Once these things are installed, you should be able to run the following:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "using TikzGraphs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Examples"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"38.587pt\" height=\"70.133pt\" viewBox=\"0 0 38.587 70.133\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285000-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285000-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.375 -0.125 L 4.375 -0.578125 L 3.859375 -0.578125 C 2.953125 -0.578125 3.125 -0.546875 3.125 -0.921875 L 3.125 -6.515625 C 3.125 -6.75 2.9375 -6.90625 2.59375 -6.90625 C 1.9375 -6.234375 1.203125 -6.265625 0.6875 -6.265625 L 0.6875 -5.6875 C 1.09375 -5.6875 1.8125 -5.734375 2 -5.828125 L 2 -0.921875 C 2 -0.5625 2.15625 -0.578125 1.265625 -0.578125 L 0.75 -0.578125 L 0.75 0.015625 C 1.296875 -0.03125 2.15625 -0.03125 2.5625 -0.03125 C 2.953125 -0.03125 3.828125 -0.03125 4.375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285000-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.46875 -2 L 4.03125 -2 C 3.984375 -1.640625 3.96875 -1.21875 3.875 -1.078125 C 3.796875 -1 3.28125 -1.03125 3.0625 -1.03125 L 1.640625 -1.03125 L 2.46875 -1.828125 C 4.015625 -3.203125 4.671875 -3.84375 4.671875 -4.828125 C 4.671875 -5.96875 3.578125 -6.90625 2.359375 -6.90625 C 1.234375 -6.90625 0.296875 -5.859375 0.296875 -4.96875 C 0.296875 -4.40625 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.75 -4.53125 1.75 -4.9375 C 1.75 -5.1875 1.359375 -5.59375 1.015625 -5.59375 C 0.9375 -5.59375 0.921875 -5.59375 1.171875 -5.671875 C 1.3125 -6.09375 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.375 -5.65625 3.375 -4.828125 C 3.375 -4.03125 2.9375 -3.34375 2.375 -2.734375 L 0.46875 -0.59375 C 0.359375 -0.484375 0.296875 -0.375 0.296875 0 L 4.359375 0 L 4.6875 -2 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285000-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.75 -1.828125 C 4.75 -2.65625 3.921875 -3.5625 2.890625 -3.78125 L 2.890625 -3.515625 C 3.703125 -3.78125 4.484375 -4.609375 4.484375 -5.390625 C 4.484375 -6.203125 3.40625 -6.90625 2.453125 -6.90625 C 1.453125 -6.90625 0.484375 -6.171875 0.484375 -5.40625 C 0.484375 -5.078125 0.90625 -4.765625 1.203125 -4.765625 C 1.5 -4.765625 1.90625 -5.109375 1.90625 -5.40625 C 1.90625 -5.90625 1.234375 -6.046875 1.359375 -6.046875 C 1.53125 -6.296875 2.046875 -6.390625 2.40625 -6.390625 C 2.828125 -6.390625 3.171875 -6.296875 3.171875 -5.40625 C 3.171875 -5.28125 3.203125 -4.8125 2.953125 -4.359375 C 2.65625 -3.890625 2.453125 -3.890625 2.203125 -3.890625 C 2.125 -3.875 1.890625 -3.859375 1.8125 -3.859375 C 1.734375 -3.84375 1.46875 -3.703125 1.46875 -3.59375 C 1.46875 -3.484375 1.734375 -3.359375 1.90625 -3.359375 L 2.34375 -3.359375 C 3.15625 -3.359375 3.328125 -2.8125 3.328125 -1.828125 C 3.328125 -0.484375 2.84375 -0.328125 2.40625 -0.328125 C 1.96875 -0.328125 1.359375 -0.453125 1.171875 -0.765625 C 1.21875 -0.765625 1.734375 -1.109375 1.734375 -1.5 C 1.734375 -1.859375 1.265625 -2.1875 0.984375 -2.1875 C 0.734375 -2.1875 0.21875 -1.90625 0.21875 -1.46875 C 0.21875 -0.5625 1.34375 0.21875 2.4375 0.21875 C 3.65625 0.21875 4.75 -0.8125 4.75 -1.828125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285000-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.890625 -1.78125 L 4.890625 -2.21875 L 3.890625 -2.21875 L 3.890625 -6.625 C 3.890625 -6.8125 3.703125 -7.015625 3.53125 -7.015625 C 3.453125 -7.015625 3.28125 -6.984375 3.203125 -6.859375 L 0.078125 -2.09375 L 0.078125 -1.640625 L 2.734375 -1.640625 L 2.734375 -0.90625 C 2.734375 -0.546875 2.90625 -0.578125 2.171875 -0.578125 L 1.765625 -0.578125 L 1.765625 0.015625 C 2.375 -0.03125 2.890625 -0.03125 3.3125 -0.03125 C 3.734375 -0.03125 4.25 -0.03125 4.859375 0.015625 L 4.859375 -0.578125 L 4.453125 -0.578125 C 3.71875 -0.578125 3.890625 -0.546875 3.890625 -0.90625 L 3.890625 -1.640625 L 4.890625 -1.640625 Z M 2.984375 -2.21875 L 0.84375 -2.21875 L 3.125 -5.71875 L 2.796875 -5.796875 L 2.796875 -2.21875 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 0.0015 -6.83925 L 0.0015 -21.050188 \" transform=\"matrix(1,0,0,-1,5.811,6.692)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.196225 1.59525 C -1.094663 0.997594 -0.0009125 0.0991563 0.299869 0.0015 C -0.0009125 -0.100062 -1.094663 -0.994594 -1.196225 -1.59225 \" transform=\"matrix(0,1,1,0,5.811,27.7431)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 0.0015 -35.183 L 0.0015 -49.288469 \" transform=\"matrix(1,0,0,-1,5.811,6.692)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195144 1.59525 C -1.097488 0.997594 0.00016875 0.0991563 0.297044 0.0015 C 0.00016875 -0.100062 -1.097488 -0.994594 -1.195144 -1.59225 \" transform=\"matrix(0,1,1,0,5.811,55.9803)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285000-0-1\" x=\"3.321\" y=\"10.01\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285000-0-2\" x=\"3.321\" y=\"38.356\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285000-0-3\" x=\"3.321\" y=\"66.593\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285000-0-4\" x=\"30.285\" y=\"10.065\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"1\\\" [],\\n2/\\\"2\\\" [],\\n3/\\\"3\\\" [],\\n4/\\\"4\\\" [],\\n;\\n1 -> [,] 2;\\n2 -> [,] 3;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "using TikzGraphs\n",
    "using LightGraphs\n",
    "g = DiGraph(4)\n",
    "add_edge!(g, 1, 2)\n",
    "add_edge!(g, 2, 3)\n",
    "TikzGraphs.plot(g)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"39.969pt\" height=\"98.37pt\" viewBox=\"0 0 39.969 98.37\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285001-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285001-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.375 -0.125 L 4.375 -0.578125 L 3.859375 -0.578125 C 2.953125 -0.578125 3.125 -0.546875 3.125 -0.921875 L 3.125 -6.515625 C 3.125 -6.75 2.9375 -6.90625 2.59375 -6.90625 C 1.9375 -6.234375 1.203125 -6.265625 0.6875 -6.265625 L 0.6875 -5.6875 C 1.09375 -5.6875 1.8125 -5.734375 2 -5.828125 L 2 -0.921875 C 2 -0.5625 2.15625 -0.578125 1.265625 -0.578125 L 0.75 -0.578125 L 0.75 0.015625 C 1.296875 -0.03125 2.15625 -0.03125 2.5625 -0.03125 C 2.953125 -0.03125 3.828125 -0.03125 4.375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285001-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.46875 -2 L 4.03125 -2 C 3.984375 -1.640625 3.96875 -1.21875 3.875 -1.078125 C 3.796875 -1 3.28125 -1.03125 3.0625 -1.03125 L 1.640625 -1.03125 L 2.46875 -1.828125 C 4.015625 -3.203125 4.671875 -3.84375 4.671875 -4.828125 C 4.671875 -5.96875 3.578125 -6.90625 2.359375 -6.90625 C 1.234375 -6.90625 0.296875 -5.859375 0.296875 -4.96875 C 0.296875 -4.40625 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.75 -4.53125 1.75 -4.9375 C 1.75 -5.1875 1.359375 -5.59375 1.015625 -5.59375 C 0.9375 -5.59375 0.921875 -5.59375 1.171875 -5.671875 C 1.3125 -6.09375 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.375 -5.65625 3.375 -4.828125 C 3.375 -4.03125 2.9375 -3.34375 2.375 -2.734375 L 0.46875 -0.59375 C 0.359375 -0.484375 0.296875 -0.375 0.296875 0 L 4.359375 0 L 4.6875 -2 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285001-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.75 -1.828125 C 4.75 -2.65625 3.921875 -3.5625 2.890625 -3.78125 L 2.890625 -3.515625 C 3.703125 -3.78125 4.484375 -4.609375 4.484375 -5.390625 C 4.484375 -6.203125 3.40625 -6.90625 2.453125 -6.90625 C 1.453125 -6.90625 0.484375 -6.171875 0.484375 -5.40625 C 0.484375 -5.078125 0.90625 -4.765625 1.203125 -4.765625 C 1.5 -4.765625 1.90625 -5.109375 1.90625 -5.40625 C 1.90625 -5.90625 1.234375 -6.046875 1.359375 -6.046875 C 1.53125 -6.296875 2.046875 -6.390625 2.40625 -6.390625 C 2.828125 -6.390625 3.171875 -6.296875 3.171875 -5.40625 C 3.171875 -5.28125 3.203125 -4.8125 2.953125 -4.359375 C 2.65625 -3.890625 2.453125 -3.890625 2.203125 -3.890625 C 2.125 -3.875 1.890625 -3.859375 1.8125 -3.859375 C 1.734375 -3.84375 1.46875 -3.703125 1.46875 -3.59375 C 1.46875 -3.484375 1.734375 -3.359375 1.90625 -3.359375 L 2.34375 -3.359375 C 3.15625 -3.359375 3.328125 -2.8125 3.328125 -1.828125 C 3.328125 -0.484375 2.84375 -0.328125 2.40625 -0.328125 C 1.96875 -0.328125 1.359375 -0.453125 1.171875 -0.765625 C 1.21875 -0.765625 1.734375 -1.109375 1.734375 -1.5 C 1.734375 -1.859375 1.265625 -2.1875 0.984375 -2.1875 C 0.734375 -2.1875 0.21875 -1.90625 0.21875 -1.46875 C 0.21875 -0.5625 1.34375 0.21875 2.4375 0.21875 C 3.65625 0.21875 4.75 -0.8125 4.75 -1.828125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285001-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.890625 -1.78125 L 4.890625 -2.21875 L 3.890625 -2.21875 L 3.890625 -6.625 C 3.890625 -6.8125 3.703125 -7.015625 3.53125 -7.015625 C 3.453125 -7.015625 3.28125 -6.984375 3.203125 -6.859375 L 0.078125 -2.09375 L 0.078125 -1.640625 L 2.734375 -1.640625 L 2.734375 -0.90625 C 2.734375 -0.546875 2.90625 -0.578125 2.171875 -0.578125 L 1.765625 -0.578125 L 1.765625 0.015625 C 2.375 -0.03125 2.890625 -0.03125 3.3125 -0.03125 C 3.734375 -0.03125 4.25 -0.03125 4.859375 0.015625 L 4.859375 -0.578125 L 4.453125 -0.578125 C 3.71875 -0.578125 3.890625 -0.546875 3.890625 -0.90625 L 3.890625 -1.640625 L 4.890625 -1.640625 Z M 2.984375 -2.21875 L 0.84375 -2.21875 L 3.125 -5.71875 L 2.796875 -5.796875 L 2.796875 -2.21875 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -6.009563 -6.010438 L -22.013469 -22.010438 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193657 1.594406 C -1.096985 0.995012 -0.000405021 0.0972951 0.300672 0.000616603 C -0.000406428 -0.101582 -1.094237 -0.996521 -1.19368 -1.593152 \" transform=\"matrix(-0.70709,0.7071,0.7071,0.70709,12.14576,28.65024)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.00175 -6.838563 L -0.00175 -77.690125 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195097 1.595906 C -1.097441 0.994344 0.000215 0.0998125 0.29709 -0.00175 C 0.000215 -0.0994063 -1.097441 -0.997844 -1.195097 -1.5955 \" transform=\"matrix(0,1,1,0,34.158,84.32791)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.3455 -35.182313 L -28.3455 -49.287781 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195831 1.59505 C -1.094269 0.997394 -0.00051875 0.0989563 0.300263 0.0013 C -0.00051875 -0.100262 -1.094269 -0.994794 -1.195831 -1.59245 \" transform=\"matrix(0,1,1,0,5.8112,55.9263)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -22.337688 -62.70575 L -6.333781 -78.70575 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.19557 1.594392 C -1.096127 0.997761 0.000465107 0.10006 0.298781 0.000623493 C 0.000466513 -0.0988172 -1.096113 -0.996534 -1.195548 -1.593166 \" transform=\"matrix(0.70709,0.7071,0.7071,-0.70709,27.82345,85.34386)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285001-0-1\" x=\"31.667\" y=\"9.955\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285001-0-2\" x=\"3.321\" y=\"38.302\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285001-0-3\" x=\"3.321\" y=\"66.539\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285001-0-4\" x=\"31.667\" y=\"95.049\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"1\\\" [],\\n2/\\\"2\\\" [],\\n3/\\\"3\\\" [],\\n4/\\\"4\\\" [],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "add_edge!(g, 3, 4)\n",
    "add_edge!(g, 1, 4)\n",
    "TikzGraphs.plot(g)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can save your graphs to PDF, SVG, and TEX."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "t = TikzGraphs.plot(g)\n",
    "using TikzPictures # this is required for saving\n",
    "TikzPictures.save(PDF(\"graph\"), t)\n",
    "TikzPictures.save(SVG(\"graph\"), t)\n",
    "TikzPictures.save(TEX(\"graph\"), t)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Labels"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can also specify the node labels."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"42.39pt\" height=\"98.649pt\" viewBox=\"0 0 42.39 98.649\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285002-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285002-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 7.34375 -0.125 L 7.34375 -0.578125 L 6.96875 -0.578125 C 6.375 -0.578125 6.4375 -0.515625 6.3125 -0.84375 L 4.171875 -7.0625 C 4.109375 -7.203125 3.890625 -7.40625 3.734375 -7.40625 C 3.578125 -7.40625 3.34375 -7.28125 3.296875 -7.140625 L 1.234375 -1.171875 C 1.0625 -0.671875 0.859375 -0.59375 0.125 -0.578125 L 0.125 0.015625 L 1.328125 -0.03125 L 2.6875 0.015625 L 2.6875 -0.578125 C 1.984375 -0.578125 1.9375 -0.6875 1.9375 -0.953125 C 1.9375 -0.984375 1.890625 -0.984375 1.96875 -1.171875 L 2.359375 -2.265625 L 4.515625 -2.265625 L 5 -0.875 C 5.015625 -0.84375 5.03125 -0.78125 5.03125 -0.734375 C 5.03125 -0.4375 4.671875 -0.578125 4.203125 -0.578125 L 4.203125 0.015625 C 4.765625 -0.03125 5.46875 -0.03125 5.84375 -0.03125 L 7.34375 0.015625 Z M 4.5625 -2.84375 L 2.5625 -2.84375 L 3.640625 -5.953125 L 3.234375 -5.953125 L 4.3125 -2.84375 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285002-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 6.6875 -1.953125 C 6.6875 -2.828125 5.671875 -3.703125 4.5625 -3.828125 L 4.5625 -3.5625 C 5.53125 -3.75 6.421875 -4.515625 6.421875 -5.25 C 6.421875 -6.125 5.296875 -7.078125 4 -7.078125 L 0.15625 -7.078125 L 0.15625 -6.5 L 0.59375 -6.5 C 1.359375 -6.5 1.1875 -6.515625 1.1875 -6.15625 L 1.1875 -0.90625 C 1.1875 -0.546875 1.359375 -0.578125 0.59375 -0.578125 L 0.15625 -0.578125 L 0.15625 0 L 4.265625 0 C 5.59375 0 6.6875 -1.015625 6.6875 -1.953125 Z M 5.046875 -5.25 C 5.046875 -4.609375 4.765625 -3.921875 3.65625 -3.921875 L 2.40625 -3.921875 L 2.40625 -6.234375 C 2.40625 -6.5625 2.234375 -6.5 2.703125 -6.5 L 3.9375 -6.5 C 4.90625 -6.5 5.046875 -5.78125 5.046875 -5.25 Z M 5.296875 -1.96875 C 5.296875 -1.25 4.96875 -0.578125 3.953125 -0.578125 L 2.703125 -0.578125 C 2.234375 -0.578125 2.40625 -0.515625 2.40625 -0.84375 L 2.40625 -3.421875 L 4.09375 -3.421875 C 5.078125 -3.421875 5.296875 -2.625 5.296875 -1.96875 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285002-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 6.828125 -2.453125 C 6.828125 -2.546875 6.625 -2.765625 6.5 -2.765625 C 6.390625 -2.765625 6.1875 -2.625 6.1875 -2.53125 C 6.09375 -1.109375 5.234375 -0.359375 4.140625 -0.359375 C 3.53125 -0.359375 1.78125 -0.5625 1.78125 -3.53125 C 1.78125 -6.515625 3.53125 -6.71875 4.140625 -6.71875 C 5.21875 -6.71875 5.90625 -5.9375 6.109375 -4.484375 C 6.125 -4.34375 6.328125 -4.1875 6.46875 -4.1875 C 6.625 -4.1875 6.828125 -4.34375 6.828125 -4.5625 L 6.828125 -6.921875 C 6.828125 -7.09375 6.625 -7.296875 6.515625 -7.296875 C 6.484375 -7.296875 6.296875 -7.25 6.21875 -7.140625 L 5.828125 -6.5625 C 5.625 -6.765625 4.984375 -7.296875 4.03125 -7.296875 C 2.15625 -7.296875 0.359375 -5.578125 0.359375 -3.53125 C 0.359375 -1.46875 2.171875 0.21875 4.03125 0.21875 C 5.65625 0.21875 6.828125 -1.296875 6.828125 -2.453125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285002-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 7.25 -3.484375 C 7.25 -5.375 5.703125 -7.078125 4 -7.078125 L 0.15625 -7.078125 L 0.15625 -6.5 L 0.59375 -6.5 C 1.359375 -6.5 1.171875 -6.515625 1.171875 -6.15625 L 1.171875 -0.90625 C 1.171875 -0.546875 1.359375 -0.578125 0.59375 -0.578125 L 0.15625 -0.578125 L 0.15625 0 L 4 0 C 5.671875 0 7.25 -1.609375 7.25 -3.484375 Z M 5.859375 -3.484375 C 5.859375 -2.375 5.71875 -1.875 5.359375 -1.390625 C 5.15625 -1.109375 4.734375 -0.578125 3.734375 -0.578125 L 2.71875 -0.578125 C 2.25 -0.578125 2.4375 -0.515625 2.4375 -0.84375 L 2.4375 -6.234375 C 2.4375 -6.5625 2.25 -6.5 2.71875 -6.5 L 3.71875 -6.5 C 4.34375 -6.5 4.890625 -6.3125 5.390625 -5.609375 C 5.828125 -5.03125 5.859375 -4.25 5.859375 -3.484375 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -7.087219 -7.085656 L -21.098938 -21.101281 \" transform=\"matrix(1,0,0,-1,35.263,6.887)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.196795 1.595425 C -1.094595 0.996036 -0.000778709 0.101095 0.300297 -0.00110486 C -0.000778709 -0.0977805 -1.097357 -0.995483 -1.194033 -1.594873 \" transform=\"matrix(-0.7071,0.7071,0.7071,0.7071,14.16234,27.98766)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.00128125 -7.085656 L -0.00128125 -77.659875 \" transform=\"matrix(1,0,0,-1,35.263,6.887)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195467 1.592469 C -1.097811 0.994812 -0.000155 0.100281 0.300626 -0.00128125 C -0.000155 -0.0989375 -1.097811 -0.997375 -1.195467 -1.595031 \" transform=\"matrix(0,1,1,0,35.263,84.54703)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.345031 -35.26925 L -28.345031 -49.093469 \" transform=\"matrix(1,0,0,-1,35.263,6.887)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195884 1.595519 C -1.094321 0.997862 -0.00057125 0.099425 0.30021 0.00176875 C -0.00057125 -0.0997938 -1.094321 -0.994325 -1.195884 -1.595888 \" transform=\"matrix(0,1,1,0,6.9162,55.98104)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -21.23175 -63.808313 L -7.247375 -77.792688 \" transform=\"matrix(1,0,0,-1,35.263,6.887)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.197908 1.594023 C -1.095728 0.994648 -0.0019682 0.099702 0.299096 -0.00250362 C -0.00197383 -0.099168 -1.095784 -0.994052 -1.195237 -1.596184 \" transform=\"matrix(0.70714,0.7071,0.7071,-0.70714,28.01683,84.68127)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285002-0-1\" x=\"31.527\" y=\"10.454\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285002-0-2\" x=\"3.39\" y=\"38.636\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285002-0-3\" x=\"3.321\" y=\"66.982\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285002-0-4\" x=\"31.458\" y=\"95.328\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"A\\\" [],\\n2/\\\"B\\\" [],\\n3/\\\"C\\\" [],\\n4/\\\"D\\\" [],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, [\"A\", \"B\", \"C\", \"D\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can even use unicode."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"41.1pt\" height=\"97.538pt\" viewBox=\"0 0 41.1 97.538\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285003-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285003-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 6.546875 -0.734375 C 6.53125 -0.796875 6.265625 -0.96875 6.203125 -0.96875 C 6.140625 -0.96875 5.90625 -0.875 5.90625 -0.796875 C 5.84375 -0.3125 5.796875 -0.15625 5.796875 -0.15625 L 5.65625 -0.375 C 5.359375 -0.375 5.359375 -1.015625 5.296875 -1.25 C 5.25 -1.46875 5.1875 -1.390625 5.25 -1.515625 C 5.90625 -2.6875 5.8125 -3.859375 5.8125 -3.859375 C 5.8125 -3.859375 5.640625 -4.1875 5.53125 -4.1875 C 5.4375 -4.1875 5.25 -4.09375 5.234375 -3.90625 C 5.21875 -3.28125 5.140625 -2.546875 4.8125 -1.96875 L 5.15625 -1.859375 L 5 -2.484375 C 4.609375 -4.046875 3.359375 -4.671875 2.625 -4.671875 C 1.25 -4.671875 0.09375 -3.109375 0.453125 -1.703125 C 0.671875 -0.78125 1.671875 0.109375 2.6875 0.109375 C 3.3125 0.109375 4.109375 -0.15625 4.515625 -0.5625 C 4.640625 -0.328125 5.25 0.109375 5.6875 0.109375 C 6.21875 0.109375 6.59375 -0.5625 6.546875 -0.734375 Z M 4.328125 -1.21875 C 3.65625 -0.453125 3.046875 -0.375 2.640625 -0.375 C 2.046875 -0.375 1.828125 -0.6875 1.671875 -1.328125 C 1.5625 -1.8125 1.546875 -2.890625 1.734375 -3.40625 C 2.03125 -4.125 2.3125 -4.1875 2.65625 -4.1875 C 3.65625 -4.1875 3.78125 -3.015625 3.96875 -2.234375 C 4.0625 -1.859375 4.203125 -1.28125 4.25 -1.140625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285003-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.046875 -1.984375 C 5.03125 -2.203125 5.015625 -2.421875 4.96875 -2.625 C 4.859375 -3.015625 4.609375 -3.484375 4.34375 -3.796875 C 4.171875 -3.96875 4 -4.109375 3.9375 -4.140625 C 3.875 -4.09375 3.96875 -4.15625 4.046875 -4.234375 C 4.359375 -4.53125 4.625 -5.03125 4.625 -5.484375 C 4.625 -5.609375 4.609375 -5.734375 4.578125 -5.859375 C 4.5 -6.15625 4.265625 -6.546875 4.03125 -6.765625 C 3.671875 -7.09375 3.078125 -7.3125 2.609375 -7.3125 C 1.421875 -7.3125 0.640625 -5.796875 0.640625 -4.515625 L 0.625 1.6875 C 0.65625 1.765625 0.90625 1.9375 0.96875 1.9375 L 1.015625 1.9375 C 1.0625 1.9375 1.3125 1.78125 1.3125 1.734375 L 1.296875 -1 L 0.953125 -0.90625 C 1.28125 -0.328125 1.96875 0.109375 2.65625 0.109375 C 3.21875 0.109375 3.921875 -0.125 4.34375 -0.5 C 4.734375 -0.859375 5.03125 -1.453125 5.046875 -1.984375 Z M 3.96875 -2.03125 C 3.96875 -1.578125 3.921875 -1.203125 3.625 -0.859375 C 3.328125 -0.53125 3.046875 -0.375 2.609375 -0.375 C 1.890625 -0.375 1.546875 -0.78125 1.359375 -1.5 C 1.328125 -1.65625 1.3125 -1.8125 1.3125 -1.984375 L 1.296875 -4.390625 C 1.3125 -5.65625 1.5625 -6.8125 2.65625 -6.8125 C 2.984375 -6.8125 3.171875 -6.703125 3.390625 -6.453125 C 3.515625 -6.296875 3.53125 -6.21875 3.578125 -6.03125 C 3.625 -5.875 3.640625 -5.703125 3.640625 -5.53125 C 3.640625 -5.15625 3.625 -4.875 3.375 -4.578125 C 3.3125 -4.515625 3.234375 -4.453125 3.25 -4.453125 C 3.09375 -4.515625 2.84375 -4.5625 2.609375 -4.5625 C 2.25 -4.5625 1.625 -4.421875 1.625 -4.15625 L 1.640625 -4.09375 C 1.6875 -3.84375 2.296875 -3.71875 2.65625 -3.71875 C 2.90625 -3.71875 3.140625 -3.765625 3.3125 -3.828125 C 3.375 -3.78125 3.515625 -3.65625 3.625 -3.5 C 3.78125 -3.296875 3.8125 -3.15625 3.875 -2.90625 C 3.953125 -2.625 3.96875 -2.328125 3.96875 -2.03125 Z M 3.015625 -4.28125 C 2.890625 -4.234375 2.734375 -4.203125 2.609375 -4.203125 C 2.375 -4.203125 2.265625 -4.0625 2.265625 -4.109375 C 2.28125 -4.203125 2.40625 -4.0625 2.65625 -4.0625 C 2.78125 -4.0625 2.90625 -4.046875 3.015625 -4.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285003-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.328125 -4.328125 C 5.296875 -4.421875 5.125 -4.34375 5.125 -4.34375 L 4.984375 -4.5625 C 4.953125 -4.5625 4.6875 -4.5 4.6875 -4.421875 C 4.40625 -3.484375 4.25 -2.484375 4.109375 -1.46875 L 4.5 -1.40625 C 4.421875 -1.71875 4.15625 -2.578125 3.53125 -3.53125 C 3.140625 -4.140625 2.484375 -4.671875 1.796875 -4.671875 C 0.546875 -4.671875 0.03125 -3.015625 0.09375 -2.71875 C 0.125 -2.609375 0.421875 -2.484375 0.625 -2.484375 L 0.75 -2.671875 C 0.84375 -3.8125 1.734375 -3.6875 1.84375 -3.6875 C 3.34375 -3.6875 3.6875 -2.078125 3.890625 -1.28125 C 4.03125 -0.671875 4.03125 -0.578125 4.015625 -0.375 C 3.984375 0.34375 3.96875 1.578125 4.03125 1.828125 C 4.0625 1.9375 4.328125 2.140625 4.40625 2.140625 C 4.53125 2.140625 4.75 1.796875 4.78125 1.421875 C 4.796875 0.578125 4.75 0.015625 4.71875 -0.296875 C 4.703125 -0.421875 4.6875 -0.5625 4.6875 -0.6875 C 4.765625 -1.671875 5.03125 -3.15625 5.234375 -3.953125 C 5.28125 -4.0625 5.34375 -4.28125 5.328125 -4.328125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285003-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.21875 -1.9375 C 4.21875 -2.28125 4.171875 -2.625 4.09375 -2.953125 C 4.0625 -3.125 4 -3.265625 3.953125 -3.421875 C 3.75 -3.890625 3.375 -4.390625 3.015625 -4.734375 C 2.4375 -5.296875 1.671875 -5.984375 1.5625 -6.4375 C 1.53125 -6.5 1.53125 -6.5625 1.5625 -6.609375 C 1.578125 -6.703125 1.578125 -6.703125 1.65625 -6.75 C 1.75 -6.796875 1.703125 -6.765625 1.8125 -6.765625 C 2.265625 -6.75 2.625 -6.4375 3.046875 -6.265625 C 3.09375 -6.265625 3.125 -6.25 3.15625 -6.25 C 3.296875 -6.25 3.625 -6.46875 3.671875 -6.59375 C 3.671875 -6.65625 3.6875 -6.71875 3.671875 -6.78125 C 3.640625 -6.90625 3.34375 -7.140625 3.203125 -7.171875 C 2.8125 -7.265625 2.359375 -7.359375 2 -7.359375 C 1.90625 -7.359375 1.828125 -7.359375 1.75 -7.34375 C 1.609375 -7.3125 1.328125 -7.234375 1.21875 -7.140625 C 1.109375 -7.0625 0.984375 -6.921875 0.9375 -6.78125 C 0.890625 -6.625 0.890625 -6.390625 0.953125 -6.203125 C 1.078125 -5.671875 1.609375 -4.9375 1.90625 -4.5625 C 1.796875 -4.53125 1.3125 -4.28125 1.03125 -3.984375 C 0.640625 -3.546875 0.390625 -2.875 0.390625 -2.359375 C 0.390625 -2.15625 0.421875 -1.890625 0.46875 -1.6875 C 0.5625 -1.328125 0.796875 -0.890625 1.0625 -0.609375 C 1.421875 -0.1875 2.109375 0.109375 2.65625 0.109375 C 3.53125 0.109375 4.21875 -0.96875 4.21875 -1.9375 Z M 3.203125 -1.75 C 3.203125 -1.03125 3.234375 -0.375 2.609375 -0.375 C 2.203125 -0.375 2 -0.5625 1.75 -0.90625 C 1.640625 -1.09375 1.59375 -1.203125 1.546875 -1.421875 C 1.46875 -1.6875 1.46875 -1.96875 1.46875 -2.25 C 1.46875 -2.765625 1.46875 -3.203125 1.765625 -3.625 C 1.9375 -3.890625 2.0625 -4.046875 2.265625 -4.109375 L 2.25 -4.125 C 2.546875 -3.765625 2.75 -3.484375 2.828125 -3.3125 C 3.078125 -2.8125 3.078125 -2.734375 3.109375 -2.5625 C 3.1875 -2.296875 3.21875 -2.09375 3.203125 -1.828125 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -5.777406 -5.774563 L -21.722719 -21.723781 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.196128 1.59436 C -1.096665 0.997767 -0.0000968778 0.100163 0.298207 0.000744819 C -0.0000870349 -0.0987029 -1.096567 -0.996415 -1.19597 -1.593018 \" transform=\"matrix(-0.70717,0.7071,0.7071,0.70717,12.8627,27.30033)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.0000625 -5.774563 L -0.0000625 -77.462063 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.19402 1.593688 C -1.096364 0.996031 0.0012925 0.1015 0.298168 -0.0000625 C 0.0012925 -0.0977187 -1.096364 -0.996156 -1.19402 -1.593812 \" transform=\"matrix(0,1,1,0,34.586,83.03777)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.347719 -36.348781 L -28.347719 -49.442531 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195531 1.592831 C -1.093969 0.995175 -0.00021875 0.100644 0.300563 -0.00091875 C -0.00021875 -0.098575 -1.093969 -0.997012 -1.195531 -1.594669 \" transform=\"matrix(0,1,1,0,6.2392,55.01975)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -21.906312 -63.133938 L -6.203187 -78.837063 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193515 1.593827 C -1.09407 0.99721 0.00250527 0.0995355 0.300816 0.000103249 C -0.000253997 -0.1021 -1.094042 -0.997043 -1.19347 -1.593663 \" transform=\"matrix(0.7071,0.70712,0.70712,-0.7071,28.38097,84.41236)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285003-0-1\" x=\"31.393\" y=\"7.724\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285003-0-2\" x=\"3.46\" y=\"36.474\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285003-0-3\" x=\"3.321\" y=\"63.4\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285003-0-4\" x=\"32.225\" y=\"94.108\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"α\\\" [],\\n2/\\\"β\\\" [],\\n3/\\\"γ\\\" [],\\n4/\\\"δ\\\" [],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, [\"α\", \"β\", \"γ\", \"δ\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can also have latex labels."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"65.167pt\" height=\"103.66pt\" viewBox=\"0 0 65.167 103.66\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 2.71875 8.765625 C 2.578125 10.40625 2.21875 10.859375 1.65625 10.859375 C 1.53125 10.859375 1.21875 10.828125 1.015625 10.640625 C 1.3125 10.609375 1.390625 10.375 1.390625 10.234375 C 1.390625 9.953125 1.171875 9.8125 0.984375 9.8125 C 0.78125 9.8125 0.5625 9.953125 0.5625 10.25 C 0.5625 10.71875 1.0625 11.078125 1.65625 11.078125 C 2.609375 11.078125 3.078125 10.203125 3.296875 9.3125 C 3.421875 8.796875 3.78125 5.890625 3.875 4.78125 L 4.0625 2.296875 C 4.203125 0.46875 4.53125 0.21875 4.984375 0.21875 C 5.078125 0.21875 5.390625 0.234375 5.609375 0.421875 C 5.328125 0.46875 5.25 0.703125 5.25 0.84375 C 5.25 1.125 5.46875 1.25 5.65625 1.25 C 5.859375 1.25 6.078125 1.125 6.078125 0.828125 C 6.078125 0.34375 5.578125 0 4.96875 0 C 4.03125 0 3.640625 0.96875 3.46875 1.71875 C 3.34375 2.265625 2.984375 5.078125 2.90625 6.296875 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-1-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-1-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.03125 -1.90625 C 3.65625 -2.34375 3.546875 -2.453125 3.28125 -2.640625 C 2.859375 -2.953125 2.40625 -3.078125 2.03125 -3.078125 C 1.15625 -3.078125 0.53125 -2.328125 0.53125 -1.5 C 0.53125 -0.6875 1.140625 0.0625 2 0.0625 C 2.96875 0.0625 3.65625 -0.71875 3.90625 -1.09375 C 4.265625 -0.65625 4.390625 -0.546875 4.640625 -0.359375 C 5.078125 -0.046875 5.515625 0.0625 5.90625 0.0625 C 6.765625 0.0625 7.390625 -0.671875 7.390625 -1.5 C 7.390625 -2.328125 6.796875 -3.078125 5.921875 -3.078125 C 4.953125 -3.078125 4.28125 -2.28125 4.03125 -1.90625 Z M 4.25 -1.65625 C 4.53125 -2.109375 5.140625 -2.8125 5.984375 -2.8125 C 6.703125 -2.8125 7.203125 -2.171875 7.203125 -1.5 C 7.203125 -0.84375 6.65625 -0.3125 6.015625 -0.3125 C 5.359375 -0.3125 4.921875 -0.84375 4.25 -1.65625 Z M 3.671875 -1.359375 C 3.40625 -0.90625 2.796875 -0.1875 1.9375 -0.1875 C 1.21875 -0.1875 0.734375 -0.828125 0.734375 -1.5 C 0.734375 -2.171875 1.28125 -2.6875 1.921875 -2.6875 C 2.5625 -2.6875 3.015625 -2.15625 3.671875 -1.359375 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-2-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-2-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 3.59375 -2.21875 C 3.59375 -2.984375 3.5 -3.546875 3.1875 -4.03125 C 2.96875 -4.34375 2.53125 -4.625 1.984375 -4.625 C 0.359375 -4.625 0.359375 -2.71875 0.359375 -2.21875 C 0.359375 -1.71875 0.359375 0.140625 1.984375 0.140625 C 3.59375 0.140625 3.59375 -1.71875 3.59375 -2.21875 Z M 1.984375 -0.0625 C 1.65625 -0.0625 1.234375 -0.25 1.09375 -0.8125 C 1 -1.21875 1 -1.796875 1 -2.3125 C 1 -2.828125 1 -3.359375 1.09375 -3.734375 C 1.25 -4.28125 1.6875 -4.4375 1.984375 -4.4375 C 2.359375 -4.4375 2.71875 -4.203125 2.84375 -3.796875 C 2.953125 -3.421875 2.96875 -2.921875 2.96875 -2.3125 C 2.96875 -1.796875 2.96875 -1.28125 2.875 -0.84375 C 2.734375 -0.203125 2.265625 -0.0625 1.984375 -0.0625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-2-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 3.515625 -1.265625 L 3.28125 -1.265625 C 3.265625 -1.109375 3.1875 -0.703125 3.09375 -0.640625 C 3.046875 -0.59375 2.515625 -0.59375 2.40625 -0.59375 L 1.125 -0.59375 C 1.859375 -1.234375 2.109375 -1.4375 2.515625 -1.765625 C 3.03125 -2.171875 3.515625 -2.609375 3.515625 -3.265625 C 3.515625 -4.109375 2.78125 -4.625 1.890625 -4.625 C 1.03125 -4.625 0.4375 -4.015625 0.4375 -3.375 C 0.4375 -3.03125 0.734375 -2.984375 0.8125 -2.984375 C 0.96875 -2.984375 1.171875 -3.109375 1.171875 -3.359375 C 1.171875 -3.484375 1.125 -3.734375 0.765625 -3.734375 C 0.984375 -4.21875 1.453125 -4.375 1.78125 -4.375 C 2.484375 -4.375 2.84375 -3.828125 2.84375 -3.265625 C 2.84375 -2.65625 2.40625 -2.1875 2.1875 -1.9375 L 0.515625 -0.265625 C 0.4375 -0.203125 0.4375 -0.1875 0.4375 0 L 3.3125 0 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-2-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 2.328125 -4.4375 C 2.328125 -4.625 2.328125 -4.625 2.125 -4.625 C 1.671875 -4.1875 1.046875 -4.1875 0.765625 -4.1875 L 0.765625 -3.9375 C 0.921875 -3.9375 1.390625 -3.9375 1.765625 -4.125 L 1.765625 -0.578125 C 1.765625 -0.34375 1.765625 -0.25 1.078125 -0.25 L 0.8125 -0.25 L 0.8125 0 C 0.9375 0 1.796875 -0.03125 2.046875 -0.03125 C 2.265625 -0.03125 3.140625 0 3.296875 0 L 3.296875 -0.25 L 3.03125 -0.25 C 2.328125 -0.25 2.328125 -0.34375 2.328125 -0.578125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-3-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-3-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 3.65625 -3.984375 L 4.515625 -3.984375 C 4.71875 -3.984375 4.8125 -3.984375 4.8125 -4.1875 C 4.8125 -4.296875 4.71875 -4.296875 4.546875 -4.296875 L 3.71875 -4.296875 L 3.921875 -5.4375 C 3.96875 -5.640625 4.109375 -6.34375 4.171875 -6.46875 C 4.25 -6.65625 4.421875 -6.8125 4.640625 -6.8125 C 4.671875 -6.8125 4.9375 -6.8125 5.125 -6.625 C 4.6875 -6.59375 4.578125 -6.234375 4.578125 -6.09375 C 4.578125 -5.859375 4.765625 -5.734375 4.953125 -5.734375 C 5.21875 -5.734375 5.5 -5.96875 5.5 -6.34375 C 5.5 -6.796875 5.046875 -7.03125 4.640625 -7.03125 C 4.296875 -7.03125 3.671875 -6.84375 3.375 -5.859375 C 3.3125 -5.65625 3.28125 -5.546875 3.046875 -4.296875 L 2.359375 -4.296875 C 2.15625 -4.296875 2.046875 -4.296875 2.046875 -4.109375 C 2.046875 -3.984375 2.140625 -3.984375 2.328125 -3.984375 L 2.984375 -3.984375 L 2.25 -0.046875 C 2.0625 0.921875 1.890625 1.828125 1.375 1.828125 C 1.328125 1.828125 1.09375 1.828125 0.890625 1.640625 C 1.359375 1.609375 1.453125 1.25 1.453125 1.109375 C 1.453125 0.875 1.265625 0.75 1.078125 0.75 C 0.8125 0.75 0.53125 0.984375 0.53125 1.359375 C 0.53125 1.796875 0.96875 2.046875 1.375 2.046875 C 1.921875 2.046875 2.328125 1.453125 2.5 1.078125 C 2.828125 0.453125 3.046875 -0.75 3.0625 -0.828125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-3-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 3.328125 -3.015625 C 3.390625 -3.265625 3.625 -4.1875 4.3125 -4.1875 C 4.359375 -4.1875 4.609375 -4.1875 4.8125 -4.0625 C 4.53125 -4 4.34375 -3.765625 4.34375 -3.515625 C 4.34375 -3.359375 4.453125 -3.171875 4.71875 -3.171875 C 4.9375 -3.171875 5.25 -3.34375 5.25 -3.75 C 5.25 -4.265625 4.671875 -4.40625 4.328125 -4.40625 C 3.75 -4.40625 3.40625 -3.875 3.28125 -3.65625 C 3.03125 -4.3125 2.5 -4.40625 2.203125 -4.40625 C 1.171875 -4.40625 0.59375 -3.125 0.59375 -2.875 C 0.59375 -2.765625 0.703125 -2.765625 0.71875 -2.765625 C 0.796875 -2.765625 0.828125 -2.796875 0.84375 -2.875 C 1.1875 -3.9375 1.84375 -4.1875 2.1875 -4.1875 C 2.375 -4.1875 2.71875 -4.09375 2.71875 -3.515625 C 2.71875 -3.203125 2.546875 -2.546875 2.1875 -1.140625 C 2.03125 -0.53125 1.671875 -0.109375 1.234375 -0.109375 C 1.171875 -0.109375 0.953125 -0.109375 0.734375 -0.234375 C 0.984375 -0.296875 1.203125 -0.5 1.203125 -0.78125 C 1.203125 -1.046875 0.984375 -1.125 0.84375 -1.125 C 0.53125 -1.125 0.296875 -0.875 0.296875 -0.546875 C 0.296875 -0.09375 0.78125 0.109375 1.21875 0.109375 C 1.890625 0.109375 2.25 -0.59375 2.265625 -0.640625 C 2.390625 -0.28125 2.75 0.109375 3.34375 0.109375 C 4.375 0.109375 4.9375 -1.171875 4.9375 -1.421875 C 4.9375 -1.53125 4.859375 -1.53125 4.828125 -1.53125 C 4.734375 -1.53125 4.71875 -1.484375 4.6875 -1.421875 C 4.359375 -0.34375 3.6875 -0.109375 3.375 -0.109375 C 2.984375 -0.109375 2.828125 -0.421875 2.828125 -0.765625 C 2.828125 -0.984375 2.875 -1.203125 2.984375 -1.640625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-3-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.140625 -6.8125 C 5.140625 -6.8125 5.140625 -6.921875 5.015625 -6.921875 C 4.859375 -6.921875 3.921875 -6.828125 3.75 -6.8125 C 3.671875 -6.796875 3.609375 -6.75 3.609375 -6.625 C 3.609375 -6.5 3.703125 -6.5 3.84375 -6.5 C 4.328125 -6.5 4.34375 -6.4375 4.34375 -6.328125 L 4.3125 -6.125 L 3.71875 -3.765625 C 3.53125 -4.140625 3.25 -4.40625 2.796875 -4.40625 C 1.640625 -4.40625 0.40625 -2.9375 0.40625 -1.484375 C 0.40625 -0.546875 0.953125 0.109375 1.71875 0.109375 C 1.921875 0.109375 2.421875 0.0625 3.015625 -0.640625 C 3.09375 -0.21875 3.453125 0.109375 3.921875 0.109375 C 4.28125 0.109375 4.5 -0.125 4.671875 -0.4375 C 4.828125 -0.796875 4.96875 -1.40625 4.96875 -1.421875 C 4.96875 -1.53125 4.875 -1.53125 4.84375 -1.53125 C 4.75 -1.53125 4.734375 -1.484375 4.703125 -1.34375 C 4.53125 -0.703125 4.359375 -0.109375 3.953125 -0.109375 C 3.671875 -0.109375 3.65625 -0.375 3.65625 -0.5625 C 3.65625 -0.8125 3.671875 -0.875 3.703125 -1.046875 Z M 3.078125 -1.1875 C 3.015625 -1 3.015625 -0.984375 2.875 -0.8125 C 2.4375 -0.265625 2.03125 -0.109375 1.75 -0.109375 C 1.25 -0.109375 1.109375 -0.65625 1.109375 -1.046875 C 1.109375 -1.546875 1.421875 -2.765625 1.65625 -3.234375 C 1.96875 -3.8125 2.40625 -4.1875 2.8125 -4.1875 C 3.453125 -4.1875 3.59375 -3.375 3.59375 -3.3125 C 3.59375 -3.25 3.578125 -3.1875 3.5625 -3.140625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-4-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-4-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 3.296875 2.390625 C 3.296875 2.359375 3.296875 2.34375 3.125 2.171875 C 1.890625 0.921875 1.5625 -0.96875 1.5625 -2.5 C 1.5625 -4.234375 1.9375 -5.96875 3.171875 -7.203125 C 3.296875 -7.328125 3.296875 -7.34375 3.296875 -7.375 C 3.296875 -7.453125 3.265625 -7.484375 3.203125 -7.484375 C 3.09375 -7.484375 2.203125 -6.796875 1.609375 -5.53125 C 1.109375 -4.4375 0.984375 -3.328125 0.984375 -2.5 C 0.984375 -1.71875 1.09375 -0.515625 1.640625 0.625 C 2.25 1.84375 3.09375 2.5 3.203125 2.5 C 3.265625 2.5 3.296875 2.46875 3.296875 2.390625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-4-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 2.875 -2.5 C 2.875 -3.265625 2.765625 -4.46875 2.21875 -5.609375 C 1.625 -6.828125 0.765625 -7.484375 0.671875 -7.484375 C 0.609375 -7.484375 0.5625 -7.4375 0.5625 -7.375 C 0.5625 -7.34375 0.5625 -7.328125 0.75 -7.140625 C 1.734375 -6.15625 2.296875 -4.578125 2.296875 -2.5 C 2.296875 -0.78125 1.9375 0.96875 0.703125 2.21875 C 0.5625 2.34375 0.5625 2.359375 0.5625 2.390625 C 0.5625 2.453125 0.609375 2.5 0.671875 2.5 C 0.765625 2.5 1.671875 1.8125 2.25 0.546875 C 2.765625 -0.546875 2.875 -1.65625 2.875 -2.5 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-4-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 1.265625 -0.765625 L 2.328125 -1.796875 C 3.875 -3.171875 4.46875 -3.703125 4.46875 -4.703125 C 4.46875 -5.84375 3.578125 -6.640625 2.359375 -6.640625 C 1.234375 -6.640625 0.5 -5.71875 0.5 -4.828125 C 0.5 -4.28125 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.546875 -4.390625 1.546875 -4.8125 C 1.546875 -5.0625 1.359375 -5.328125 1.015625 -5.328125 C 0.9375 -5.328125 0.921875 -5.328125 0.890625 -5.3125 C 1.109375 -5.96875 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.5625 -5.515625 3.5625 -4.703125 C 3.5625 -3.90625 3.078125 -3.125 2.515625 -2.5 L 0.609375 -0.375 C 0.5 -0.265625 0.5 -0.234375 0.5 0 L 4.203125 0 L 4.46875 -1.734375 L 4.234375 -1.734375 C 4.171875 -1.4375 4.109375 -1 4 -0.84375 C 3.9375 -0.765625 3.28125 -0.765625 3.0625 -0.765625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-5-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285004-5-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 3.875 8.515625 L 2.125 4.640625 C 2.046875 4.484375 2 4.484375 1.96875 4.484375 C 1.96875 4.484375 1.90625 4.484375 1.796875 4.5625 L 0.859375 5.28125 C 0.734375 5.390625 0.734375 5.40625 0.734375 5.4375 C 0.734375 5.5 0.75 5.546875 0.828125 5.546875 C 0.890625 5.546875 1.0625 5.40625 1.171875 5.328125 C 1.21875 5.28125 1.375 5.171875 1.484375 5.09375 L 3.453125 9.40625 C 3.515625 9.5625 3.5625 9.5625 3.65625 9.5625 C 3.8125 9.5625 3.84375 9.515625 3.90625 9.375 L 8.4375 0 C 8.5 -0.140625 8.5 -0.171875 8.5 -0.203125 C 8.5 -0.296875 8.421875 -0.40625 8.296875 -0.40625 C 8.21875 -0.40625 8.15625 -0.34375 8.078125 -0.1875 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -9.574625 -9.575219 L -19.320719 -19.321313 \" transform=\"matrix(1,0,0,-1,38.309,9.374)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.197845 1.594141 C -1.095638 0.994762 -0.00182486 0.0998492 0.299248 -0.00234512 C -0.00182204 -0.0990237 -1.09561 -0.993967 -1.195038 -1.596111 \" transform=\"matrix(-0.70712,0.7071,0.7071,0.70712,18.9867,28.69631)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.00040625 -9.575219 L -0.00040625 -75.137719 \" transform=\"matrix(1,0,0,-1,38.309,9.374)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193654 1.593344 C -1.095997 0.995688 0.00165875 0.101156 0.298534 -0.00040625 C 0.00165875 -0.0980625 -1.095997 -0.9965 -1.193654 -1.594156 \" transform=\"matrix(0,1,1,0,38.309,84.51006)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.348062 -37.047875 L -28.348062 -48.661156 \" transform=\"matrix(1,0,0,-1,38.309,9.374)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.194796 1.592488 C -1.09714 0.994831 0.00051625 0.1003 0.297391 -0.0012625 C 0.00051625 -0.0989187 -1.09714 -0.997356 -1.194796 -1.595012 \" transform=\"matrix(0,1,1,0,9.9622,58.03464)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -20.773844 -64.266625 L -7.023844 -78.016625 \" transform=\"matrix(1,0,0,-1,38.309,9.374)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.194251 1.593728 C -1.094823 0.997108 0.00172762 0.0994019 0.300036 -0.0000387144 C 0.00172481 -0.0994709 -1.094851 -0.997145 -1.194296 -1.593763 \" transform=\"matrix(0.70712,0.7071,0.7071,-0.70712,31.28396,87.38938)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-0-1\" x=\"14.771\" y=\"3.86\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-1-1\" x=\"21.413\" y=\"6.323\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-2-1\" x=\"19.476\" y=\"15.428\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-3-1\" x=\"31.574\" y=\"11.885\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-4-1\" x=\"37.524\" y=\"11.885\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-3-2\" x=\"41.398\" y=\"11.885\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-4-2\" x=\"47.092\" y=\"11.885\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-3-3\" x=\"50.967\" y=\"11.885\"/>\n",
       "  <use xlink:href=\"#glyph-1517795316285004-3-2\" x=\"56.152554\" y=\"11.885\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-5-1\" x=\"3.321\" y=\"33.337\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.398;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.00190625 0.00128125 L 4.982469 0.00128125 \" transform=\"matrix(1,0,0,-1,11.623,33.138)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-4-3\" x=\"11.623\" y=\"41.578\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-3-2\" x=\"4.851\" y=\"70.122\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-2-2\" x=\"10.545\" y=\"66.506\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-2-3\" x=\"36.323\" y=\"92.981\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.398;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 0.00121875 -0.0010625 L 3.969969 -0.0010625 \" transform=\"matrix(1,0,0,-1,36.323,94.413)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285004-2-2\" x=\"36.323\" y=\"100.339\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"\\$\\\\int_0^\\\\infty f(x) dx\\$\\\" [],\\n2/\\\"\\$\\\\sqrt{2}\\$\\\" [],\\n3/\\\"\\$x^2\\$\\\" [],\\n4/\\\"\\$\\\\frac{1}{2}\\$\\\" [],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, [L\"\\int_0^\\infty f(x) dx\", L\"\\sqrt{2}\", L\"x^2\", L\"\\frac{1}{2}\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can have repeated labels."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"41.1pt\" height=\"96.193pt\" viewBox=\"0 0 41.1 96.193\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285005-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285005-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 6.546875 -0.734375 C 6.53125 -0.796875 6.265625 -0.96875 6.203125 -0.96875 C 6.140625 -0.96875 5.90625 -0.875 5.90625 -0.796875 C 5.84375 -0.3125 5.796875 -0.15625 5.796875 -0.15625 L 5.65625 -0.375 C 5.359375 -0.375 5.359375 -1.015625 5.296875 -1.25 C 5.25 -1.46875 5.1875 -1.390625 5.25 -1.515625 C 5.90625 -2.6875 5.8125 -3.859375 5.8125 -3.859375 C 5.8125 -3.859375 5.640625 -4.1875 5.53125 -4.1875 C 5.4375 -4.1875 5.25 -4.09375 5.234375 -3.90625 C 5.21875 -3.28125 5.140625 -2.546875 4.8125 -1.96875 L 5.15625 -1.859375 L 5 -2.484375 C 4.609375 -4.046875 3.359375 -4.671875 2.625 -4.671875 C 1.25 -4.671875 0.09375 -3.109375 0.453125 -1.703125 C 0.671875 -0.78125 1.671875 0.109375 2.6875 0.109375 C 3.3125 0.109375 4.109375 -0.15625 4.515625 -0.5625 C 4.640625 -0.328125 5.25 0.109375 5.6875 0.109375 C 6.21875 0.109375 6.59375 -0.5625 6.546875 -0.734375 Z M 4.328125 -1.21875 C 3.65625 -0.453125 3.046875 -0.375 2.640625 -0.375 C 2.046875 -0.375 1.828125 -0.6875 1.671875 -1.328125 C 1.5625 -1.8125 1.546875 -2.890625 1.734375 -3.40625 C 2.03125 -4.125 2.3125 -4.1875 2.65625 -4.1875 C 3.65625 -4.1875 3.78125 -3.015625 3.96875 -2.234375 C 4.0625 -1.859375 4.203125 -1.28125 4.25 -1.140625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285005-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.046875 -1.984375 C 5.03125 -2.203125 5.015625 -2.421875 4.96875 -2.625 C 4.859375 -3.015625 4.609375 -3.484375 4.34375 -3.796875 C 4.171875 -3.96875 4 -4.109375 3.9375 -4.140625 C 3.875 -4.09375 3.96875 -4.15625 4.046875 -4.234375 C 4.359375 -4.53125 4.625 -5.03125 4.625 -5.484375 C 4.625 -5.609375 4.609375 -5.734375 4.578125 -5.859375 C 4.5 -6.15625 4.265625 -6.546875 4.03125 -6.765625 C 3.671875 -7.09375 3.078125 -7.3125 2.609375 -7.3125 C 1.421875 -7.3125 0.640625 -5.796875 0.640625 -4.515625 L 0.625 1.6875 C 0.65625 1.765625 0.90625 1.9375 0.96875 1.9375 L 1.015625 1.9375 C 1.0625 1.9375 1.3125 1.78125 1.3125 1.734375 L 1.296875 -1 L 0.953125 -0.90625 C 1.28125 -0.328125 1.96875 0.109375 2.65625 0.109375 C 3.21875 0.109375 3.921875 -0.125 4.34375 -0.5 C 4.734375 -0.859375 5.03125 -1.453125 5.046875 -1.984375 Z M 3.96875 -2.03125 C 3.96875 -1.578125 3.921875 -1.203125 3.625 -0.859375 C 3.328125 -0.53125 3.046875 -0.375 2.609375 -0.375 C 1.890625 -0.375 1.546875 -0.78125 1.359375 -1.5 C 1.328125 -1.65625 1.3125 -1.8125 1.3125 -1.984375 L 1.296875 -4.390625 C 1.3125 -5.65625 1.5625 -6.8125 2.65625 -6.8125 C 2.984375 -6.8125 3.171875 -6.703125 3.390625 -6.453125 C 3.515625 -6.296875 3.53125 -6.21875 3.578125 -6.03125 C 3.625 -5.875 3.640625 -5.703125 3.640625 -5.53125 C 3.640625 -5.15625 3.625 -4.875 3.375 -4.578125 C 3.3125 -4.515625 3.234375 -4.453125 3.25 -4.453125 C 3.09375 -4.515625 2.84375 -4.5625 2.609375 -4.5625 C 2.25 -4.5625 1.625 -4.421875 1.625 -4.15625 L 1.640625 -4.09375 C 1.6875 -3.84375 2.296875 -3.71875 2.65625 -3.71875 C 2.90625 -3.71875 3.140625 -3.765625 3.3125 -3.828125 C 3.375 -3.78125 3.515625 -3.65625 3.625 -3.5 C 3.78125 -3.296875 3.8125 -3.15625 3.875 -2.90625 C 3.953125 -2.625 3.96875 -2.328125 3.96875 -2.03125 Z M 3.015625 -4.28125 C 2.890625 -4.234375 2.734375 -4.203125 2.609375 -4.203125 C 2.375 -4.203125 2.265625 -4.0625 2.265625 -4.109375 C 2.28125 -4.203125 2.40625 -4.0625 2.65625 -4.0625 C 2.78125 -4.0625 2.90625 -4.046875 3.015625 -4.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285005-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.328125 -4.328125 C 5.296875 -4.421875 5.125 -4.34375 5.125 -4.34375 L 4.984375 -4.5625 C 4.953125 -4.5625 4.6875 -4.5 4.6875 -4.421875 C 4.40625 -3.484375 4.25 -2.484375 4.109375 -1.46875 L 4.5 -1.40625 C 4.421875 -1.71875 4.15625 -2.578125 3.53125 -3.53125 C 3.140625 -4.140625 2.484375 -4.671875 1.796875 -4.671875 C 0.546875 -4.671875 0.03125 -3.015625 0.09375 -2.71875 C 0.125 -2.609375 0.421875 -2.484375 0.625 -2.484375 L 0.75 -2.671875 C 0.84375 -3.8125 1.734375 -3.6875 1.84375 -3.6875 C 3.34375 -3.6875 3.6875 -2.078125 3.890625 -1.28125 C 4.03125 -0.671875 4.03125 -0.578125 4.015625 -0.375 C 3.984375 0.34375 3.96875 1.578125 4.03125 1.828125 C 4.0625 1.9375 4.328125 2.140625 4.40625 2.140625 C 4.53125 2.140625 4.75 1.796875 4.78125 1.421875 C 4.796875 0.578125 4.75 0.015625 4.71875 -0.296875 C 4.703125 -0.421875 4.6875 -0.5625 4.6875 -0.6875 C 4.765625 -1.671875 5.03125 -3.15625 5.234375 -3.953125 C 5.28125 -4.0625 5.34375 -4.28125 5.328125 -4.328125 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -5.777406 -5.774563 L -21.722719 -21.723781 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.196128 1.59436 C -1.096665 0.997767 -0.0000968778 0.100163 0.298207 0.000744819 C -0.0000870349 -0.0987029 -1.096567 -0.996415 -1.19597 -1.593018 \" transform=\"matrix(-0.70717,0.7071,0.7071,0.70717,12.8627,27.30033)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.0000625 -5.774563 L -0.0000625 -78.805813 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.19526 1.593688 C -1.097604 0.996031 0.0000525 0.1015 0.296928 -0.0000625 C 0.0000525 -0.0977187 -1.097604 -0.996156 -1.19526 -1.593812 \" transform=\"matrix(0,1,1,0,34.586,84.38276)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.347719 -36.348781 L -28.347719 -49.442531 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195531 1.592831 C -1.093969 0.995175 -0.00021875 0.100644 0.300562 -0.00091875 C -0.00021875 -0.098575 -1.093969 -0.997012 -1.195531 -1.594669 \" transform=\"matrix(0,1,1,0,6.2392,55.01975)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -21.906312 -63.133938 L -6.101625 -78.938625 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.197834 1.593881 C -1.095634 0.994492 -0.00181728 0.099551 0.296496 0.000113138 C -0.00181728 -0.0993247 -1.095634 -0.994265 -1.197834 -1.593655 \" transform=\"matrix(0.7071,0.7071,0.7071,-0.7071,28.48558,84.51699)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285005-0-1\" x=\"31.393\" y=\"7.724\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285005-0-2\" x=\"3.46\" y=\"36.473\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285005-0-3\" x=\"3.321\" y=\"63.4\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285005-0-1\" x=\"31.393\" y=\"92.763\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"α\\\" [],\\n2/\\\"β\\\" [],\\n3/\\\"γ\\\" [],\\n4/\\\"α\\\" [],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, [\"α\", \"β\", \"γ\", \"α\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can specify the style for the nodes."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"41.498pt\" height=\"96.592pt\" viewBox=\"0 0 41.498 96.592\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285006-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285006-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 6.546875 -0.734375 C 6.53125 -0.796875 6.265625 -0.96875 6.203125 -0.96875 C 6.140625 -0.96875 5.90625 -0.875 5.90625 -0.796875 C 5.84375 -0.3125 5.796875 -0.15625 5.796875 -0.15625 L 5.65625 -0.375 C 5.359375 -0.375 5.359375 -1.015625 5.296875 -1.25 C 5.25 -1.46875 5.1875 -1.390625 5.25 -1.515625 C 5.90625 -2.6875 5.8125 -3.859375 5.8125 -3.859375 C 5.8125 -3.859375 5.640625 -4.1875 5.53125 -4.1875 C 5.4375 -4.1875 5.25 -4.09375 5.234375 -3.90625 C 5.21875 -3.28125 5.140625 -2.546875 4.8125 -1.96875 L 5.15625 -1.859375 L 5 -2.484375 C 4.609375 -4.046875 3.359375 -4.671875 2.625 -4.671875 C 1.25 -4.671875 0.09375 -3.109375 0.453125 -1.703125 C 0.671875 -0.78125 1.671875 0.109375 2.6875 0.109375 C 3.3125 0.109375 4.109375 -0.15625 4.515625 -0.5625 C 4.640625 -0.328125 5.25 0.109375 5.6875 0.109375 C 6.21875 0.109375 6.59375 -0.5625 6.546875 -0.734375 Z M 4.328125 -1.21875 C 3.65625 -0.453125 3.046875 -0.375 2.640625 -0.375 C 2.046875 -0.375 1.828125 -0.6875 1.671875 -1.328125 C 1.5625 -1.8125 1.546875 -2.890625 1.734375 -3.40625 C 2.03125 -4.125 2.3125 -4.1875 2.65625 -4.1875 C 3.65625 -4.1875 3.78125 -3.015625 3.96875 -2.234375 C 4.0625 -1.859375 4.203125 -1.28125 4.25 -1.140625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285006-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.046875 -1.984375 C 5.03125 -2.203125 5.015625 -2.421875 4.96875 -2.625 C 4.859375 -3.015625 4.609375 -3.484375 4.34375 -3.796875 C 4.171875 -3.96875 4 -4.109375 3.9375 -4.140625 C 3.875 -4.09375 3.96875 -4.15625 4.046875 -4.234375 C 4.359375 -4.53125 4.625 -5.03125 4.625 -5.484375 C 4.625 -5.609375 4.609375 -5.734375 4.578125 -5.859375 C 4.5 -6.15625 4.265625 -6.546875 4.03125 -6.765625 C 3.671875 -7.09375 3.078125 -7.3125 2.609375 -7.3125 C 1.421875 -7.3125 0.640625 -5.796875 0.640625 -4.515625 L 0.625 1.6875 C 0.65625 1.765625 0.90625 1.9375 0.96875 1.9375 L 1.015625 1.9375 C 1.0625 1.9375 1.3125 1.78125 1.3125 1.734375 L 1.296875 -1 L 0.953125 -0.90625 C 1.28125 -0.328125 1.96875 0.109375 2.65625 0.109375 C 3.21875 0.109375 3.921875 -0.125 4.34375 -0.5 C 4.734375 -0.859375 5.03125 -1.453125 5.046875 -1.984375 Z M 3.96875 -2.03125 C 3.96875 -1.578125 3.921875 -1.203125 3.625 -0.859375 C 3.328125 -0.53125 3.046875 -0.375 2.609375 -0.375 C 1.890625 -0.375 1.546875 -0.78125 1.359375 -1.5 C 1.328125 -1.65625 1.3125 -1.8125 1.3125 -1.984375 L 1.296875 -4.390625 C 1.3125 -5.65625 1.5625 -6.8125 2.65625 -6.8125 C 2.984375 -6.8125 3.171875 -6.703125 3.390625 -6.453125 C 3.515625 -6.296875 3.53125 -6.21875 3.578125 -6.03125 C 3.625 -5.875 3.640625 -5.703125 3.640625 -5.53125 C 3.640625 -5.15625 3.625 -4.875 3.375 -4.578125 C 3.3125 -4.515625 3.234375 -4.453125 3.25 -4.453125 C 3.09375 -4.515625 2.84375 -4.5625 2.609375 -4.5625 C 2.25 -4.5625 1.625 -4.421875 1.625 -4.15625 L 1.640625 -4.09375 C 1.6875 -3.84375 2.296875 -3.71875 2.65625 -3.71875 C 2.90625 -3.71875 3.140625 -3.765625 3.3125 -3.828125 C 3.375 -3.78125 3.515625 -3.65625 3.625 -3.5 C 3.78125 -3.296875 3.8125 -3.15625 3.875 -2.90625 C 3.953125 -2.625 3.96875 -2.328125 3.96875 -2.03125 Z M 3.015625 -4.28125 C 2.890625 -4.234375 2.734375 -4.203125 2.609375 -4.203125 C 2.375 -4.203125 2.265625 -4.0625 2.265625 -4.109375 C 2.28125 -4.203125 2.40625 -4.0625 2.65625 -4.0625 C 2.78125 -4.0625 2.90625 -4.046875 3.015625 -4.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285006-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.328125 -4.328125 C 5.296875 -4.421875 5.125 -4.34375 5.125 -4.34375 L 4.984375 -4.5625 C 4.953125 -4.5625 4.6875 -4.5 4.6875 -4.421875 C 4.40625 -3.484375 4.25 -2.484375 4.109375 -1.46875 L 4.5 -1.40625 C 4.421875 -1.71875 4.15625 -2.578125 3.53125 -3.53125 C 3.140625 -4.140625 2.484375 -4.671875 1.796875 -4.671875 C 0.546875 -4.671875 0.03125 -3.015625 0.09375 -2.71875 C 0.125 -2.609375 0.421875 -2.484375 0.625 -2.484375 L 0.75 -2.671875 C 0.84375 -3.8125 1.734375 -3.6875 1.84375 -3.6875 C 3.34375 -3.6875 3.6875 -2.078125 3.890625 -1.28125 C 4.03125 -0.671875 4.03125 -0.578125 4.015625 -0.375 C 3.984375 0.34375 3.96875 1.578125 4.03125 1.828125 C 4.0625 1.9375 4.328125 2.140625 4.40625 2.140625 C 4.53125 2.140625 4.75 1.796875 4.78125 1.421875 C 4.796875 0.578125 4.75 0.015625 4.71875 -0.296875 C 4.703125 -0.421875 4.6875 -0.5625 4.6875 -0.6875 C 4.765625 -1.671875 5.03125 -3.15625 5.234375 -3.953125 C 5.28125 -4.0625 5.34375 -4.28125 5.328125 -4.328125 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -4.980313 -4.981813 L -22.2225 -22.220094 \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193923 1.594828 C -1.097248 0.995439 -0.000669106 0.0977364 0.300407 0.00106067 C -0.000669106 -0.101139 -1.094485 -0.99608 -1.196685 -1.595469 \" transform=\"matrix(-0.7071,0.7071,0.7071,0.7071,12.56323,27.99777)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 0.00015625 -5.774781 L 0.00015625 -78.806031 \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195021 1.593906 C -1.097365 0.99625 0.00029125 0.0978125 0.297166 0.00015625 C 0.00029125 -0.101406 -1.097365 -0.995938 -1.195021 -1.593594 \" transform=\"matrix(0,1,1,0,34.785,84.58174)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.3475 -36.349 L -28.3475 -49.44275 \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195293 1.59305 C -1.097636 0.995394 0.00002 0.100862 0.300801 -0.0007 C 0.00002 -0.0983563 -1.097636 -0.996794 -1.195293 -1.59445 \" transform=\"matrix(0,1,1,0,6.4382,55.21873)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -22.960781 -62.079469 L -5.304531 -79.735719 \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193935 1.593882 C -1.094507 0.997262 0.00204317 0.0995566 0.300351 0.00011596 C 0.00204036 -0.0993163 -1.094535 -0.996991 -1.19398 -1.593608 \" transform=\"matrix(0.70712,0.7071,0.7071,-0.70712,29.47894,85.51036)\"/>\n",
       "<path style=\"fill-rule:nonzero;fill:rgb(89.99939%,89.99939%,100%);fill-opacity:1;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 2.5275 5.576781 L -2.527188 5.576781 C -4.730313 5.576781 -6.515469 3.791625 -6.515469 1.592406 L -6.515469 -1.591188 C -6.515469 -3.794313 -4.730313 -5.575563 -2.527188 -5.575563 L 2.5275 -5.575563 C 4.730625 -5.575563 6.511875 -3.794313 6.511875 -1.591188 L 6.511875 1.592406 C 6.511875 3.791625 4.730625 5.576781 2.5275 5.576781 Z \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285006-0-1\" x=\"31.592\" y=\"7.923\"/>\n",
       "</g>\n",
       "<path style=\"fill-rule:nonzero;fill:rgb(89.99939%,89.99939%,100%);fill-opacity:1;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 2.115687 7.802687 L -2.114781 7.802687 C -4.317906 7.802687 -6.099156 6.021437 -6.099156 3.818312 L -6.099156 -3.818406 C -6.099156 -6.021531 -4.317906 -7.802781 -2.114781 -7.802781 L 2.115687 -7.802781 C 4.314906 -7.802781 6.100062 -6.021531 6.100062 -3.818406 L 6.100062 3.818312 C 6.100062 6.021437 4.314906 7.802687 2.115687 7.802687 Z \" transform=\"matrix(1,0,0,-1,6.439,34.123)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285006-0-2\" x=\"3.659\" y=\"36.673\"/>\n",
       "</g>\n",
       "<path style=\"fill-rule:nonzero;fill:rgb(89.99939%,89.99939%,100%);fill-opacity:1;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 2.256312 6.594 L -2.255406 6.594 C -4.454625 6.594 -6.239781 4.808844 -6.239781 2.609625 L -6.239781 -2.609125 C -6.239781 -4.808344 -4.454625 -6.5935 -2.255406 -6.5935 L 2.256312 -6.5935 C 4.455531 -6.5935 6.240687 -4.808344 6.240687 -2.609125 L 6.240687 2.609625 C 6.240687 4.808844 4.455531 6.594 2.256312 6.594 Z \" transform=\"matrix(1,0,0,-1,6.439,62.469)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285006-0-3\" x=\"3.52\" y=\"63.6\"/>\n",
       "</g>\n",
       "<path style=\"fill-rule:nonzero;fill:rgb(89.99939%,89.99939%,100%);fill-opacity:1;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 2.5275 5.577719 L -2.527188 5.577719 C -4.730313 5.577719 -6.515469 3.792563 -6.515469 1.593344 L -6.515469 -1.59025 C -6.515469 -3.793375 -4.730313 -5.578531 -2.527188 -5.578531 L 2.5275 -5.578531 C 4.730625 -5.578531 6.511875 -3.793375 6.511875 -1.59025 L 6.511875 1.593344 C 6.511875 3.792563 4.730625 5.577719 2.5275 5.577719 Z \" transform=\"matrix(1,0,0,-1,34.785,90.816)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285006-0-1\" x=\"31.592\" y=\"92.963\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"α\\\" [draw, rounded corners, fill=blue!10],\\n2/\\\"β\\\" [draw, rounded corners, fill=blue!10],\\n3/\\\"γ\\\" [draw, rounded corners, fill=blue!10],\\n4/\\\"α\\\" [draw, rounded corners, fill=blue!10],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, [\"α\", \"β\", \"γ\", \"α\"], node_style=\"draw, rounded corners, fill=blue!10\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can override the styles of selected nodes using a dictionary."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"41.498pt\" height=\"96.592pt\" viewBox=\"0 0 41.498 96.592\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285007-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285007-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 6.546875 -0.734375 C 6.53125 -0.796875 6.265625 -0.96875 6.203125 -0.96875 C 6.140625 -0.96875 5.90625 -0.875 5.90625 -0.796875 C 5.84375 -0.3125 5.796875 -0.15625 5.796875 -0.15625 L 5.65625 -0.375 C 5.359375 -0.375 5.359375 -1.015625 5.296875 -1.25 C 5.25 -1.46875 5.1875 -1.390625 5.25 -1.515625 C 5.90625 -2.6875 5.8125 -3.859375 5.8125 -3.859375 C 5.8125 -3.859375 5.640625 -4.1875 5.53125 -4.1875 C 5.4375 -4.1875 5.25 -4.09375 5.234375 -3.90625 C 5.21875 -3.28125 5.140625 -2.546875 4.8125 -1.96875 L 5.15625 -1.859375 L 5 -2.484375 C 4.609375 -4.046875 3.359375 -4.671875 2.625 -4.671875 C 1.25 -4.671875 0.09375 -3.109375 0.453125 -1.703125 C 0.671875 -0.78125 1.671875 0.109375 2.6875 0.109375 C 3.3125 0.109375 4.109375 -0.15625 4.515625 -0.5625 C 4.640625 -0.328125 5.25 0.109375 5.6875 0.109375 C 6.21875 0.109375 6.59375 -0.5625 6.546875 -0.734375 Z M 4.328125 -1.21875 C 3.65625 -0.453125 3.046875 -0.375 2.640625 -0.375 C 2.046875 -0.375 1.828125 -0.6875 1.671875 -1.328125 C 1.5625 -1.8125 1.546875 -2.890625 1.734375 -3.40625 C 2.03125 -4.125 2.3125 -4.1875 2.65625 -4.1875 C 3.65625 -4.1875 3.78125 -3.015625 3.96875 -2.234375 C 4.0625 -1.859375 4.203125 -1.28125 4.25 -1.140625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285007-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.046875 -1.984375 C 5.03125 -2.203125 5.015625 -2.421875 4.96875 -2.625 C 4.859375 -3.015625 4.609375 -3.484375 4.34375 -3.796875 C 4.171875 -3.96875 4 -4.109375 3.9375 -4.140625 C 3.875 -4.09375 3.96875 -4.15625 4.046875 -4.234375 C 4.359375 -4.53125 4.625 -5.03125 4.625 -5.484375 C 4.625 -5.609375 4.609375 -5.734375 4.578125 -5.859375 C 4.5 -6.15625 4.265625 -6.546875 4.03125 -6.765625 C 3.671875 -7.09375 3.078125 -7.3125 2.609375 -7.3125 C 1.421875 -7.3125 0.640625 -5.796875 0.640625 -4.515625 L 0.625 1.6875 C 0.65625 1.765625 0.90625 1.9375 0.96875 1.9375 L 1.015625 1.9375 C 1.0625 1.9375 1.3125 1.78125 1.3125 1.734375 L 1.296875 -1 L 0.953125 -0.90625 C 1.28125 -0.328125 1.96875 0.109375 2.65625 0.109375 C 3.21875 0.109375 3.921875 -0.125 4.34375 -0.5 C 4.734375 -0.859375 5.03125 -1.453125 5.046875 -1.984375 Z M 3.96875 -2.03125 C 3.96875 -1.578125 3.921875 -1.203125 3.625 -0.859375 C 3.328125 -0.53125 3.046875 -0.375 2.609375 -0.375 C 1.890625 -0.375 1.546875 -0.78125 1.359375 -1.5 C 1.328125 -1.65625 1.3125 -1.8125 1.3125 -1.984375 L 1.296875 -4.390625 C 1.3125 -5.65625 1.5625 -6.8125 2.65625 -6.8125 C 2.984375 -6.8125 3.171875 -6.703125 3.390625 -6.453125 C 3.515625 -6.296875 3.53125 -6.21875 3.578125 -6.03125 C 3.625 -5.875 3.640625 -5.703125 3.640625 -5.53125 C 3.640625 -5.15625 3.625 -4.875 3.375 -4.578125 C 3.3125 -4.515625 3.234375 -4.453125 3.25 -4.453125 C 3.09375 -4.515625 2.84375 -4.5625 2.609375 -4.5625 C 2.25 -4.5625 1.625 -4.421875 1.625 -4.15625 L 1.640625 -4.09375 C 1.6875 -3.84375 2.296875 -3.71875 2.65625 -3.71875 C 2.90625 -3.71875 3.140625 -3.765625 3.3125 -3.828125 C 3.375 -3.78125 3.515625 -3.65625 3.625 -3.5 C 3.78125 -3.296875 3.8125 -3.15625 3.875 -2.90625 C 3.953125 -2.625 3.96875 -2.328125 3.96875 -2.03125 Z M 3.015625 -4.28125 C 2.890625 -4.234375 2.734375 -4.203125 2.609375 -4.203125 C 2.375 -4.203125 2.265625 -4.0625 2.265625 -4.109375 C 2.28125 -4.203125 2.40625 -4.0625 2.65625 -4.0625 C 2.78125 -4.0625 2.90625 -4.046875 3.015625 -4.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285007-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.328125 -4.328125 C 5.296875 -4.421875 5.125 -4.34375 5.125 -4.34375 L 4.984375 -4.5625 C 4.953125 -4.5625 4.6875 -4.5 4.6875 -4.421875 C 4.40625 -3.484375 4.25 -2.484375 4.109375 -1.46875 L 4.5 -1.40625 C 4.421875 -1.71875 4.15625 -2.578125 3.53125 -3.53125 C 3.140625 -4.140625 2.484375 -4.671875 1.796875 -4.671875 C 0.546875 -4.671875 0.03125 -3.015625 0.09375 -2.71875 C 0.125 -2.609375 0.421875 -2.484375 0.625 -2.484375 L 0.75 -2.671875 C 0.84375 -3.8125 1.734375 -3.6875 1.84375 -3.6875 C 3.34375 -3.6875 3.6875 -2.078125 3.890625 -1.28125 C 4.03125 -0.671875 4.03125 -0.578125 4.015625 -0.375 C 3.984375 0.34375 3.96875 1.578125 4.03125 1.828125 C 4.0625 1.9375 4.328125 2.140625 4.40625 2.140625 C 4.53125 2.140625 4.75 1.796875 4.78125 1.421875 C 4.796875 0.578125 4.75 0.015625 4.71875 -0.296875 C 4.703125 -0.421875 4.6875 -0.5625 4.6875 -0.6875 C 4.765625 -1.671875 5.03125 -3.15625 5.234375 -3.953125 C 5.28125 -4.0625 5.34375 -4.28125 5.328125 -4.328125 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -4.980313 -4.981813 L -22.2225 -22.220094 \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193923 1.594828 C -1.097248 0.995439 -0.000669106 0.0977364 0.300407 0.00106067 C -0.000669106 -0.101139 -1.094485 -0.99608 -1.196685 -1.595469 \" transform=\"matrix(-0.7071,0.7071,0.7071,0.7071,12.56323,27.99777)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 0.00015625 -5.774781 L 0.00015625 -78.806031 \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195021 1.593906 C -1.097365 0.99625 0.00029125 0.0978125 0.297166 0.00015625 C 0.00029125 -0.101406 -1.097365 -0.995938 -1.195021 -1.593594 \" transform=\"matrix(0,1,1,0,34.785,84.58174)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.3475 -36.349 L -28.3475 -49.44275 \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195293 1.59305 C -1.097636 0.995394 0.00002 0.100862 0.300801 -0.0007 C 0.00002 -0.0983563 -1.097636 -0.996794 -1.195293 -1.59445 \" transform=\"matrix(0,1,1,0,6.4382,55.21873)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -22.960781 -62.079469 L -5.304531 -79.735719 \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193935 1.593882 C -1.094507 0.997262 0.00204317 0.0995566 0.300351 0.00011596 C 0.00204036 -0.0993163 -1.094535 -0.996991 -1.19398 -1.593608 \" transform=\"matrix(0.70712,0.7071,0.7071,-0.70712,29.47894,85.51036)\"/>\n",
       "<path style=\"fill-rule:nonzero;fill:rgb(89.99939%,100%,89.99939%);fill-opacity:1;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 2.5275 5.576781 L -2.527188 5.576781 C -4.730313 5.576781 -6.515469 3.791625 -6.515469 1.592406 L -6.515469 -1.591188 C -6.515469 -3.794313 -4.730313 -5.575563 -2.527188 -5.575563 L 2.5275 -5.575563 C 4.730625 -5.575563 6.511875 -3.794313 6.511875 -1.591188 L 6.511875 1.592406 C 6.511875 3.791625 4.730625 5.576781 2.5275 5.576781 Z \" transform=\"matrix(1,0,0,-1,34.785,5.776)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285007-0-1\" x=\"31.592\" y=\"7.923\"/>\n",
       "</g>\n",
       "<path style=\"fill-rule:nonzero;fill:rgb(89.99939%,89.99939%,100%);fill-opacity:1;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 2.115687 7.802687 L -2.114781 7.802687 C -4.317906 7.802687 -6.099156 6.021437 -6.099156 3.818312 L -6.099156 -3.818406 C -6.099156 -6.021531 -4.317906 -7.802781 -2.114781 -7.802781 L 2.115687 -7.802781 C 4.314906 -7.802781 6.100062 -6.021531 6.100062 -3.818406 L 6.100062 3.818312 C 6.100062 6.021437 4.314906 7.802687 2.115687 7.802687 Z \" transform=\"matrix(1,0,0,-1,6.439,34.123)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285007-0-2\" x=\"3.659\" y=\"36.673\"/>\n",
       "</g>\n",
       "<path style=\"fill-rule:nonzero;fill:rgb(100%,99.488831%,90.000916%);fill-opacity:1;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 2.256312 6.594 L -2.255406 6.594 C -4.454625 6.594 -6.239781 4.808844 -6.239781 2.609625 L -6.239781 -2.609125 C -6.239781 -4.808344 -4.454625 -6.5935 -2.255406 -6.5935 L 2.256312 -6.5935 C 4.455531 -6.5935 6.240687 -4.808344 6.240687 -2.609125 L 6.240687 2.609625 C 6.240687 4.808844 4.455531 6.594 2.256312 6.594 Z \" transform=\"matrix(1,0,0,-1,6.439,62.469)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285007-0-3\" x=\"3.52\" y=\"63.6\"/>\n",
       "</g>\n",
       "<path style=\"fill-rule:nonzero;fill:rgb(89.99939%,89.99939%,100%);fill-opacity:1;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 2.5275 5.577719 L -2.527188 5.577719 C -4.730313 5.577719 -6.515469 3.792563 -6.515469 1.593344 L -6.515469 -1.59025 C -6.515469 -3.793375 -4.730313 -5.578531 -2.527188 -5.578531 L 2.5275 -5.578531 C 4.730625 -5.578531 6.511875 -3.793375 6.511875 -1.59025 L 6.511875 1.593344 C 6.511875 3.792563 4.730625 5.577719 2.5275 5.577719 Z \" transform=\"matrix(1,0,0,-1,34.785,90.816)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285007-0-1\" x=\"31.592\" y=\"92.963\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"α\\\" [draw, rounded corners, fill=blue!10,fill=green!10],\\n2/\\\"β\\\" [draw, rounded corners, fill=blue!10],\\n3/\\\"γ\\\" [draw, rounded corners, fill=blue!10,fill=yellow!10],\\n4/\\\"α\\\" [draw, rounded corners, fill=blue!10],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, [\"α\", \"β\", \"γ\", \"α\"], node_style=\"draw, rounded corners, fill=blue!10\", node_styles=Dict(1=>\"fill=green!10\",3=>\"fill=yellow!10\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Edges"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can set edge labels using a dictionary."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"46.687pt\" height=\"96.193pt\" viewBox=\"0 0 46.687 96.193\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285008-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285008-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.34375 -0.125 L 5.34375 -0.578125 C 4.609375 -0.578125 4.5625 -0.5625 4.34375 -0.84375 L 3.078125 -2.46875 C 3.296875 -2.765625 3.671875 -3.25 3.921875 -3.515625 C 4.234375 -3.875 4.5 -3.984375 5.15625 -3.984375 L 5.15625 -4.578125 C 4.703125 -4.546875 4.40625 -4.53125 4.140625 -4.53125 C 3.84375 -4.53125 3.3125 -4.5625 2.984375 -4.578125 L 2.984375 -4 C 3.40625 -3.96875 3.28125 -3.96875 3.28125 -3.8125 C 3.28125 -3.65625 3.234375 -3.625 3.1875 -3.5625 L 2.71875 -2.953125 L 2.078125 -3.78125 C 1.984375 -3.890625 2.046875 -3.8125 2.046875 -3.875 C 2.046875 -4.015625 2 -3.984375 2.390625 -4 L 2.390625 -4.578125 L 1.109375 -4.53125 C 0.90625 -4.53125 0.4375 -4.546875 -0.03125 -4.578125 L -0.03125 -3.984375 C 0.875 -3.984375 0.734375 -4.015625 1.203125 -3.421875 L 2.109375 -2.21875 C 1.71875 -1.71875 1.71875 -1.703125 1.25 -1.140625 C 0.78125 -0.5625 0.328125 -0.578125 -0.078125 -0.578125 L -0.078125 0.015625 C 0.375 -0.015625 0.6875 -0.03125 0.953125 -0.03125 L 2.09375 0.015625 L 2.09375 -0.546875 C 1.671875 -0.609375 1.796875 -0.59375 1.796875 -0.75 C 1.796875 -0.96875 2.03125 -1.203125 2.5 -1.75 L 3.125 -0.921875 C 3.203125 -0.8125 3.265625 -0.75 3.265625 -0.6875 C 3.265625 -0.59375 3.375 -0.59375 2.90625 -0.5625 L 2.90625 0.015625 L 4.1875 -0.03125 C 4.453125 -0.03125 4.84375 -0.015625 5.34375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285008-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.265625 -4.109375 L 5.265625 -4.578125 C 4.828125 -4.546875 4.546875 -4.53125 4.3125 -4.53125 L 3.25 -4.578125 L 3.25 -3.984375 C 3.765625 -3.984375 3.71875 -3.9375 3.71875 -3.6875 C 3.71875 -3.59375 3.703125 -3.640625 3.65625 -3.515625 L 2.65625 -1.0625 L 3.046875 -1 L 1.9375 -3.671875 C 1.90625 -3.78125 1.890625 -3.8125 1.890625 -3.859375 C 1.890625 -4.109375 2.046875 -3.984375 2.4375 -3.984375 L 2.4375 -4.578125 L 1.15625 -4.53125 C 0.890625 -4.53125 0.484375 -4.546875 -0.015625 -4.578125 L -0.015625 -3.984375 C 0.671875 -3.984375 0.65625 -4.109375 0.796875 -3.765625 L 2.265625 -0.15625 L 2.046875 0.390625 C 1.828125 0.9375 1.75 1.5625 1.109375 1.5625 C 1.0625 1.5625 0.96875 1.59375 0.984375 1.609375 C 0.953125 1.609375 1.21875 1.25 1.21875 1.09375 C 1.21875 0.84375 0.84375 0.53125 0.609375 0.53125 C 0.40625 0.53125 -0.015625 0.8125 -0.015625 1.109375 C -0.015625 1.5625 0.609375 2.046875 1.109375 2.046875 C 1.734375 2.046875 2.34375 1.34375 2.578125 0.78125 L 4.34375 -3.484375 C 4.59375 -4.109375 4.90625 -3.984375 5.265625 -3.984375 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285008-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 6.546875 -0.734375 C 6.53125 -0.796875 6.265625 -0.96875 6.203125 -0.96875 C 6.140625 -0.96875 5.90625 -0.875 5.90625 -0.796875 C 5.84375 -0.3125 5.796875 -0.15625 5.796875 -0.15625 L 5.65625 -0.375 C 5.359375 -0.375 5.359375 -1.015625 5.296875 -1.25 C 5.25 -1.46875 5.1875 -1.390625 5.25 -1.515625 C 5.90625 -2.6875 5.8125 -3.859375 5.8125 -3.859375 C 5.8125 -3.859375 5.640625 -4.1875 5.53125 -4.1875 C 5.4375 -4.1875 5.25 -4.09375 5.234375 -3.90625 C 5.21875 -3.28125 5.140625 -2.546875 4.8125 -1.96875 L 5.15625 -1.859375 L 5 -2.484375 C 4.609375 -4.046875 3.359375 -4.671875 2.625 -4.671875 C 1.25 -4.671875 0.09375 -3.109375 0.453125 -1.703125 C 0.671875 -0.78125 1.671875 0.109375 2.6875 0.109375 C 3.3125 0.109375 4.109375 -0.15625 4.515625 -0.5625 C 4.640625 -0.328125 5.25 0.109375 5.6875 0.109375 C 6.21875 0.109375 6.59375 -0.5625 6.546875 -0.734375 Z M 4.328125 -1.21875 C 3.65625 -0.453125 3.046875 -0.375 2.640625 -0.375 C 2.046875 -0.375 1.828125 -0.6875 1.671875 -1.328125 C 1.5625 -1.8125 1.546875 -2.890625 1.734375 -3.40625 C 2.03125 -4.125 2.3125 -4.1875 2.65625 -4.1875 C 3.65625 -4.1875 3.78125 -3.015625 3.96875 -2.234375 C 4.0625 -1.859375 4.203125 -1.28125 4.25 -1.140625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285008-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.046875 -1.984375 C 5.03125 -2.203125 5.015625 -2.421875 4.96875 -2.625 C 4.859375 -3.015625 4.609375 -3.484375 4.34375 -3.796875 C 4.171875 -3.96875 4 -4.109375 3.9375 -4.140625 C 3.875 -4.09375 3.96875 -4.15625 4.046875 -4.234375 C 4.359375 -4.53125 4.625 -5.03125 4.625 -5.484375 C 4.625 -5.609375 4.609375 -5.734375 4.578125 -5.859375 C 4.5 -6.15625 4.265625 -6.546875 4.03125 -6.765625 C 3.671875 -7.09375 3.078125 -7.3125 2.609375 -7.3125 C 1.421875 -7.3125 0.640625 -5.796875 0.640625 -4.515625 L 0.625 1.6875 C 0.65625 1.765625 0.90625 1.9375 0.96875 1.9375 L 1.015625 1.9375 C 1.0625 1.9375 1.3125 1.78125 1.3125 1.734375 L 1.296875 -1 L 0.953125 -0.90625 C 1.28125 -0.328125 1.96875 0.109375 2.65625 0.109375 C 3.21875 0.109375 3.921875 -0.125 4.34375 -0.5 C 4.734375 -0.859375 5.03125 -1.453125 5.046875 -1.984375 Z M 3.96875 -2.03125 C 3.96875 -1.578125 3.921875 -1.203125 3.625 -0.859375 C 3.328125 -0.53125 3.046875 -0.375 2.609375 -0.375 C 1.890625 -0.375 1.546875 -0.78125 1.359375 -1.5 C 1.328125 -1.65625 1.3125 -1.8125 1.3125 -1.984375 L 1.296875 -4.390625 C 1.3125 -5.65625 1.5625 -6.8125 2.65625 -6.8125 C 2.984375 -6.8125 3.171875 -6.703125 3.390625 -6.453125 C 3.515625 -6.296875 3.53125 -6.21875 3.578125 -6.03125 C 3.625 -5.875 3.640625 -5.703125 3.640625 -5.53125 C 3.640625 -5.15625 3.625 -4.875 3.375 -4.578125 C 3.3125 -4.515625 3.234375 -4.453125 3.25 -4.453125 C 3.09375 -4.515625 2.84375 -4.5625 2.609375 -4.5625 C 2.25 -4.5625 1.625 -4.421875 1.625 -4.15625 L 1.640625 -4.09375 C 1.6875 -3.84375 2.296875 -3.71875 2.65625 -3.71875 C 2.90625 -3.71875 3.140625 -3.765625 3.3125 -3.828125 C 3.375 -3.78125 3.515625 -3.65625 3.625 -3.5 C 3.78125 -3.296875 3.8125 -3.15625 3.875 -2.90625 C 3.953125 -2.625 3.96875 -2.328125 3.96875 -2.03125 Z M 3.015625 -4.28125 C 2.890625 -4.234375 2.734375 -4.203125 2.609375 -4.203125 C 2.375 -4.203125 2.265625 -4.0625 2.265625 -4.109375 C 2.28125 -4.203125 2.40625 -4.0625 2.65625 -4.0625 C 2.78125 -4.0625 2.90625 -4.046875 3.015625 -4.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285008-0-5\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.328125 -4.328125 C 5.296875 -4.421875 5.125 -4.34375 5.125 -4.34375 L 4.984375 -4.5625 C 4.953125 -4.5625 4.6875 -4.5 4.6875 -4.421875 C 4.40625 -3.484375 4.25 -2.484375 4.109375 -1.46875 L 4.5 -1.40625 C 4.421875 -1.71875 4.15625 -2.578125 3.53125 -3.53125 C 3.140625 -4.140625 2.484375 -4.671875 1.796875 -4.671875 C 0.546875 -4.671875 0.03125 -3.015625 0.09375 -2.71875 C 0.125 -2.609375 0.421875 -2.484375 0.625 -2.484375 L 0.75 -2.671875 C 0.84375 -3.8125 1.734375 -3.6875 1.84375 -3.6875 C 3.34375 -3.6875 3.6875 -2.078125 3.890625 -1.28125 C 4.03125 -0.671875 4.03125 -0.578125 4.015625 -0.375 C 3.984375 0.34375 3.96875 1.578125 4.03125 1.828125 C 4.0625 1.9375 4.328125 2.140625 4.40625 2.140625 C 4.53125 2.140625 4.75 1.796875 4.78125 1.421875 C 4.796875 0.578125 4.75 0.015625 4.71875 -0.296875 C 4.703125 -0.421875 4.6875 -0.5625 4.6875 -0.6875 C 4.765625 -1.671875 5.03125 -3.15625 5.234375 -3.953125 C 5.28125 -4.0625 5.34375 -4.28125 5.328125 -4.328125 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -5.777406 -5.774563 L -21.722719 -21.723781 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.196128 1.59436 C -1.096665 0.997767 -0.0000968778 0.100163 0.298207 0.000744819 C -0.0000870349 -0.0987029 -1.096567 -0.996415 -1.19597 -1.593018 \" transform=\"matrix(-0.70717,0.7071,0.7071,0.70717,12.8627,27.30033)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285008-0-1\" x=\"24.194\" y=\"27.302\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.0000625 -5.774563 L -0.0000625 -78.805813 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.19526 1.593688 C -1.097604 0.996031 0.0000525 0.1015 0.296928 -0.0000625 C 0.0000525 -0.0977187 -1.097604 -0.996156 -1.19526 -1.593812 \" transform=\"matrix(0,1,1,0,34.586,84.38276)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285008-0-2\" x=\"38.106\" y=\"74.68\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.347719 -36.348781 L -28.347719 -49.442531 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195531 1.592831 C -1.093969 0.995175 -0.00021875 0.100644 0.300562 -0.00091875 C -0.00021875 -0.098575 -1.093969 -0.997012 -1.195531 -1.594669 \" transform=\"matrix(0,1,1,0,6.2392,55.01975)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -21.906312 -63.133938 L -6.101625 -78.938625 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.197834 1.593881 C -1.095634 0.994492 -0.00181728 0.099551 0.296496 0.000113138 C -0.00181728 -0.0993247 -1.095634 -0.994265 -1.197834 -1.593655 \" transform=\"matrix(0.7071,0.7071,0.7071,-0.7071,28.48558,84.51699)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285008-0-3\" x=\"31.393\" y=\"7.724\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285008-0-4\" x=\"3.46\" y=\"36.473\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285008-0-5\" x=\"3.321\" y=\"63.4\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285008-0-3\" x=\"31.393\" y=\"92.763\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"α\\\" [],\\n2/\\\"β\\\" [],\\n3/\\\"γ\\\" [],\\n4/\\\"α\\\" [],\\n;\\n1 -> [,edge label={x},] 2;\\n1 -> [,edge label={y},] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, [\"α\", \"β\", \"γ\", \"α\"], edge_labels=Dict((1,2)=>\"x\", (1,4)=>\"y\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can set the style for the edges."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"46.687pt\" height=\"96.193pt\" viewBox=\"0 0 46.687 96.193\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285009-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285009-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.34375 -0.125 L 5.34375 -0.578125 C 4.609375 -0.578125 4.5625 -0.5625 4.34375 -0.84375 L 3.078125 -2.46875 C 3.296875 -2.765625 3.671875 -3.25 3.921875 -3.515625 C 4.234375 -3.875 4.5 -3.984375 5.15625 -3.984375 L 5.15625 -4.578125 C 4.703125 -4.546875 4.40625 -4.53125 4.140625 -4.53125 C 3.84375 -4.53125 3.3125 -4.5625 2.984375 -4.578125 L 2.984375 -4 C 3.40625 -3.96875 3.28125 -3.96875 3.28125 -3.8125 C 3.28125 -3.65625 3.234375 -3.625 3.1875 -3.5625 L 2.71875 -2.953125 L 2.078125 -3.78125 C 1.984375 -3.890625 2.046875 -3.8125 2.046875 -3.875 C 2.046875 -4.015625 2 -3.984375 2.390625 -4 L 2.390625 -4.578125 L 1.109375 -4.53125 C 0.90625 -4.53125 0.4375 -4.546875 -0.03125 -4.578125 L -0.03125 -3.984375 C 0.875 -3.984375 0.734375 -4.015625 1.203125 -3.421875 L 2.109375 -2.21875 C 1.71875 -1.71875 1.71875 -1.703125 1.25 -1.140625 C 0.78125 -0.5625 0.328125 -0.578125 -0.078125 -0.578125 L -0.078125 0.015625 C 0.375 -0.015625 0.6875 -0.03125 0.953125 -0.03125 L 2.09375 0.015625 L 2.09375 -0.546875 C 1.671875 -0.609375 1.796875 -0.59375 1.796875 -0.75 C 1.796875 -0.96875 2.03125 -1.203125 2.5 -1.75 L 3.125 -0.921875 C 3.203125 -0.8125 3.265625 -0.75 3.265625 -0.6875 C 3.265625 -0.59375 3.375 -0.59375 2.90625 -0.5625 L 2.90625 0.015625 L 4.1875 -0.03125 C 4.453125 -0.03125 4.84375 -0.015625 5.34375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285009-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.265625 -4.109375 L 5.265625 -4.578125 C 4.828125 -4.546875 4.546875 -4.53125 4.3125 -4.53125 L 3.25 -4.578125 L 3.25 -3.984375 C 3.765625 -3.984375 3.71875 -3.9375 3.71875 -3.6875 C 3.71875 -3.59375 3.703125 -3.640625 3.65625 -3.515625 L 2.65625 -1.0625 L 3.046875 -1 L 1.9375 -3.671875 C 1.90625 -3.78125 1.890625 -3.8125 1.890625 -3.859375 C 1.890625 -4.109375 2.046875 -3.984375 2.4375 -3.984375 L 2.4375 -4.578125 L 1.15625 -4.53125 C 0.890625 -4.53125 0.484375 -4.546875 -0.015625 -4.578125 L -0.015625 -3.984375 C 0.671875 -3.984375 0.65625 -4.109375 0.796875 -3.765625 L 2.265625 -0.15625 L 2.046875 0.390625 C 1.828125 0.9375 1.75 1.5625 1.109375 1.5625 C 1.0625 1.5625 0.96875 1.59375 0.984375 1.609375 C 0.953125 1.609375 1.21875 1.25 1.21875 1.09375 C 1.21875 0.84375 0.84375 0.53125 0.609375 0.53125 C 0.40625 0.53125 -0.015625 0.8125 -0.015625 1.109375 C -0.015625 1.5625 0.609375 2.046875 1.109375 2.046875 C 1.734375 2.046875 2.34375 1.34375 2.578125 0.78125 L 4.34375 -3.484375 C 4.59375 -4.109375 4.90625 -3.984375 5.265625 -3.984375 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285009-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 6.546875 -0.734375 C 6.53125 -0.796875 6.265625 -0.96875 6.203125 -0.96875 C 6.140625 -0.96875 5.90625 -0.875 5.90625 -0.796875 C 5.84375 -0.3125 5.796875 -0.15625 5.796875 -0.15625 L 5.65625 -0.375 C 5.359375 -0.375 5.359375 -1.015625 5.296875 -1.25 C 5.25 -1.46875 5.1875 -1.390625 5.25 -1.515625 C 5.90625 -2.6875 5.8125 -3.859375 5.8125 -3.859375 C 5.8125 -3.859375 5.640625 -4.1875 5.53125 -4.1875 C 5.4375 -4.1875 5.25 -4.09375 5.234375 -3.90625 C 5.21875 -3.28125 5.140625 -2.546875 4.8125 -1.96875 L 5.15625 -1.859375 L 5 -2.484375 C 4.609375 -4.046875 3.359375 -4.671875 2.625 -4.671875 C 1.25 -4.671875 0.09375 -3.109375 0.453125 -1.703125 C 0.671875 -0.78125 1.671875 0.109375 2.6875 0.109375 C 3.3125 0.109375 4.109375 -0.15625 4.515625 -0.5625 C 4.640625 -0.328125 5.25 0.109375 5.6875 0.109375 C 6.21875 0.109375 6.59375 -0.5625 6.546875 -0.734375 Z M 4.328125 -1.21875 C 3.65625 -0.453125 3.046875 -0.375 2.640625 -0.375 C 2.046875 -0.375 1.828125 -0.6875 1.671875 -1.328125 C 1.5625 -1.8125 1.546875 -2.890625 1.734375 -3.40625 C 2.03125 -4.125 2.3125 -4.1875 2.65625 -4.1875 C 3.65625 -4.1875 3.78125 -3.015625 3.96875 -2.234375 C 4.0625 -1.859375 4.203125 -1.28125 4.25 -1.140625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285009-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.046875 -1.984375 C 5.03125 -2.203125 5.015625 -2.421875 4.96875 -2.625 C 4.859375 -3.015625 4.609375 -3.484375 4.34375 -3.796875 C 4.171875 -3.96875 4 -4.109375 3.9375 -4.140625 C 3.875 -4.09375 3.96875 -4.15625 4.046875 -4.234375 C 4.359375 -4.53125 4.625 -5.03125 4.625 -5.484375 C 4.625 -5.609375 4.609375 -5.734375 4.578125 -5.859375 C 4.5 -6.15625 4.265625 -6.546875 4.03125 -6.765625 C 3.671875 -7.09375 3.078125 -7.3125 2.609375 -7.3125 C 1.421875 -7.3125 0.640625 -5.796875 0.640625 -4.515625 L 0.625 1.6875 C 0.65625 1.765625 0.90625 1.9375 0.96875 1.9375 L 1.015625 1.9375 C 1.0625 1.9375 1.3125 1.78125 1.3125 1.734375 L 1.296875 -1 L 0.953125 -0.90625 C 1.28125 -0.328125 1.96875 0.109375 2.65625 0.109375 C 3.21875 0.109375 3.921875 -0.125 4.34375 -0.5 C 4.734375 -0.859375 5.03125 -1.453125 5.046875 -1.984375 Z M 3.96875 -2.03125 C 3.96875 -1.578125 3.921875 -1.203125 3.625 -0.859375 C 3.328125 -0.53125 3.046875 -0.375 2.609375 -0.375 C 1.890625 -0.375 1.546875 -0.78125 1.359375 -1.5 C 1.328125 -1.65625 1.3125 -1.8125 1.3125 -1.984375 L 1.296875 -4.390625 C 1.3125 -5.65625 1.5625 -6.8125 2.65625 -6.8125 C 2.984375 -6.8125 3.171875 -6.703125 3.390625 -6.453125 C 3.515625 -6.296875 3.53125 -6.21875 3.578125 -6.03125 C 3.625 -5.875 3.640625 -5.703125 3.640625 -5.53125 C 3.640625 -5.15625 3.625 -4.875 3.375 -4.578125 C 3.3125 -4.515625 3.234375 -4.453125 3.25 -4.453125 C 3.09375 -4.515625 2.84375 -4.5625 2.609375 -4.5625 C 2.25 -4.5625 1.625 -4.421875 1.625 -4.15625 L 1.640625 -4.09375 C 1.6875 -3.84375 2.296875 -3.71875 2.65625 -3.71875 C 2.90625 -3.71875 3.140625 -3.765625 3.3125 -3.828125 C 3.375 -3.78125 3.515625 -3.65625 3.625 -3.5 C 3.78125 -3.296875 3.8125 -3.15625 3.875 -2.90625 C 3.953125 -2.625 3.96875 -2.328125 3.96875 -2.03125 Z M 3.015625 -4.28125 C 2.890625 -4.234375 2.734375 -4.203125 2.609375 -4.203125 C 2.375 -4.203125 2.265625 -4.0625 2.265625 -4.109375 C 2.28125 -4.203125 2.40625 -4.0625 2.65625 -4.0625 C 2.78125 -4.0625 2.90625 -4.046875 3.015625 -4.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285009-0-5\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.328125 -4.328125 C 5.296875 -4.421875 5.125 -4.34375 5.125 -4.34375 L 4.984375 -4.5625 C 4.953125 -4.5625 4.6875 -4.5 4.6875 -4.421875 C 4.40625 -3.484375 4.25 -2.484375 4.109375 -1.46875 L 4.5 -1.40625 C 4.421875 -1.71875 4.15625 -2.578125 3.53125 -3.53125 C 3.140625 -4.140625 2.484375 -4.671875 1.796875 -4.671875 C 0.546875 -4.671875 0.03125 -3.015625 0.09375 -2.71875 C 0.125 -2.609375 0.421875 -2.484375 0.625 -2.484375 L 0.75 -2.671875 C 0.84375 -3.8125 1.734375 -3.6875 1.84375 -3.6875 C 3.34375 -3.6875 3.6875 -2.078125 3.890625 -1.28125 C 4.03125 -0.671875 4.03125 -0.578125 4.015625 -0.375 C 3.984375 0.34375 3.96875 1.578125 4.03125 1.828125 C 4.0625 1.9375 4.328125 2.140625 4.40625 2.140625 C 4.53125 2.140625 4.75 1.796875 4.78125 1.421875 C 4.796875 0.578125 4.75 0.015625 4.71875 -0.296875 C 4.703125 -0.421875 4.6875 -0.5625 4.6875 -0.6875 C 4.765625 -1.671875 5.03125 -3.15625 5.234375 -3.953125 C 5.28125 -4.0625 5.34375 -4.28125 5.328125 -4.328125 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -5.777406 -5.774563 L -21.722719 -21.723781 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.196128 1.59436 C -1.096665 0.997767 -0.0000968778 0.100163 0.298207 0.000744819 C -0.0000870349 -0.0987029 -1.096567 -0.996415 -1.19597 -1.593018 \" transform=\"matrix(-0.70717,0.7071,0.7071,0.70717,12.8627,27.30033)\"/>\n",
       "<g style=\"fill:rgb(0%,100%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285009-0-1\" x=\"24.194\" y=\"27.302\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.0000625 -5.774563 L -0.0000625 -78.805813 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.19526 1.593688 C -1.097604 0.996031 0.0000525 0.1015 0.296928 -0.0000625 C 0.0000525 -0.0977187 -1.097604 -0.996156 -1.19526 -1.593812 \" transform=\"matrix(0,1,1,0,34.586,84.38276)\"/>\n",
       "<g style=\"fill:rgb(0%,100%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285009-0-2\" x=\"38.106\" y=\"74.68\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.347719 -36.348781 L -28.347719 -49.442531 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195531 1.592831 C -1.093969 0.995175 -0.00021875 0.100644 0.300562 -0.00091875 C -0.00021875 -0.098575 -1.093969 -0.997012 -1.195531 -1.594669 \" transform=\"matrix(0,1,1,0,6.2392,55.01975)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -21.906312 -63.133938 L -6.101625 -78.938625 \" transform=\"matrix(1,0,0,-1,34.586,5.577)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.197834 1.593881 C -1.095634 0.994492 -0.00181728 0.099551 0.296496 0.000113138 C -0.00181728 -0.0993247 -1.095634 -0.994265 -1.197834 -1.593655 \" transform=\"matrix(0.7071,0.7071,0.7071,-0.7071,28.48558,84.51699)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285009-0-3\" x=\"31.393\" y=\"7.724\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285009-0-4\" x=\"3.46\" y=\"36.473\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285009-0-5\" x=\"3.321\" y=\"63.4\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285009-0-3\" x=\"31.393\" y=\"92.763\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"α\\\" [],\\n2/\\\"β\\\" [],\\n3/\\\"γ\\\" [],\\n4/\\\"α\\\" [],\\n;\\n1 -> [green,edge label={x},] 2;\\n1 -> [green,edge label={y},] 4;\\n2 -> [green,] 3;\\n3 -> [green,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, [\"α\", \"β\", \"γ\", \"α\"], edge_labels=Dict((1,2)=>\"x\", (1,4)=>\"y\"), edge_style=\"green\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can overide the style for specific edges as specified by a dictionary."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"46.258pt\" height=\"98.37pt\" viewBox=\"0 0 46.258 98.37\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285010-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285010-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.34375 -0.125 L 5.34375 -0.578125 C 4.609375 -0.578125 4.5625 -0.5625 4.34375 -0.84375 L 3.078125 -2.46875 C 3.296875 -2.765625 3.671875 -3.25 3.921875 -3.515625 C 4.234375 -3.875 4.5 -3.984375 5.15625 -3.984375 L 5.15625 -4.578125 C 4.703125 -4.546875 4.40625 -4.53125 4.140625 -4.53125 C 3.84375 -4.53125 3.3125 -4.5625 2.984375 -4.578125 L 2.984375 -4 C 3.40625 -3.96875 3.28125 -3.96875 3.28125 -3.8125 C 3.28125 -3.65625 3.234375 -3.625 3.1875 -3.5625 L 2.71875 -2.953125 L 2.078125 -3.78125 C 1.984375 -3.890625 2.046875 -3.8125 2.046875 -3.875 C 2.046875 -4.015625 2 -3.984375 2.390625 -4 L 2.390625 -4.578125 L 1.109375 -4.53125 C 0.90625 -4.53125 0.4375 -4.546875 -0.03125 -4.578125 L -0.03125 -3.984375 C 0.875 -3.984375 0.734375 -4.015625 1.203125 -3.421875 L 2.109375 -2.21875 C 1.71875 -1.71875 1.71875 -1.703125 1.25 -1.140625 C 0.78125 -0.5625 0.328125 -0.578125 -0.078125 -0.578125 L -0.078125 0.015625 C 0.375 -0.015625 0.6875 -0.03125 0.953125 -0.03125 L 2.09375 0.015625 L 2.09375 -0.546875 C 1.671875 -0.609375 1.796875 -0.59375 1.796875 -0.75 C 1.796875 -0.96875 2.03125 -1.203125 2.5 -1.75 L 3.125 -0.921875 C 3.203125 -0.8125 3.265625 -0.75 3.265625 -0.6875 C 3.265625 -0.59375 3.375 -0.59375 2.90625 -0.5625 L 2.90625 0.015625 L 4.1875 -0.03125 C 4.453125 -0.03125 4.84375 -0.015625 5.34375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285010-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 5.265625 -4.109375 L 5.265625 -4.578125 C 4.828125 -4.546875 4.546875 -4.53125 4.3125 -4.53125 L 3.25 -4.578125 L 3.25 -3.984375 C 3.765625 -3.984375 3.71875 -3.9375 3.71875 -3.6875 C 3.71875 -3.59375 3.703125 -3.640625 3.65625 -3.515625 L 2.65625 -1.0625 L 3.046875 -1 L 1.9375 -3.671875 C 1.90625 -3.78125 1.890625 -3.8125 1.890625 -3.859375 C 1.890625 -4.109375 2.046875 -3.984375 2.4375 -3.984375 L 2.4375 -4.578125 L 1.15625 -4.53125 C 0.890625 -4.53125 0.484375 -4.546875 -0.015625 -4.578125 L -0.015625 -3.984375 C 0.671875 -3.984375 0.65625 -4.109375 0.796875 -3.765625 L 2.265625 -0.15625 L 2.046875 0.390625 C 1.828125 0.9375 1.75 1.5625 1.109375 1.5625 C 1.0625 1.5625 0.96875 1.59375 0.984375 1.609375 C 0.953125 1.609375 1.21875 1.25 1.21875 1.09375 C 1.21875 0.84375 0.84375 0.53125 0.609375 0.53125 C 0.40625 0.53125 -0.015625 0.8125 -0.015625 1.109375 C -0.015625 1.5625 0.609375 2.046875 1.109375 2.046875 C 1.734375 2.046875 2.34375 1.34375 2.578125 0.78125 L 4.34375 -3.484375 C 4.59375 -4.109375 4.90625 -3.984375 5.265625 -3.984375 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285010-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.375 -0.125 L 4.375 -0.578125 L 3.859375 -0.578125 C 2.953125 -0.578125 3.125 -0.546875 3.125 -0.921875 L 3.125 -6.515625 C 3.125 -6.75 2.9375 -6.90625 2.59375 -6.90625 C 1.9375 -6.234375 1.203125 -6.265625 0.6875 -6.265625 L 0.6875 -5.6875 C 1.09375 -5.6875 1.8125 -5.734375 2 -5.828125 L 2 -0.921875 C 2 -0.5625 2.15625 -0.578125 1.265625 -0.578125 L 0.75 -0.578125 L 0.75 0.015625 C 1.296875 -0.03125 2.15625 -0.03125 2.5625 -0.03125 C 2.953125 -0.03125 3.828125 -0.03125 4.375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285010-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.46875 -2 L 4.03125 -2 C 3.984375 -1.640625 3.96875 -1.21875 3.875 -1.078125 C 3.796875 -1 3.28125 -1.03125 3.0625 -1.03125 L 1.640625 -1.03125 L 2.46875 -1.828125 C 4.015625 -3.203125 4.671875 -3.84375 4.671875 -4.828125 C 4.671875 -5.96875 3.578125 -6.90625 2.359375 -6.90625 C 1.234375 -6.90625 0.296875 -5.859375 0.296875 -4.96875 C 0.296875 -4.40625 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.75 -4.53125 1.75 -4.9375 C 1.75 -5.1875 1.359375 -5.59375 1.015625 -5.59375 C 0.9375 -5.59375 0.921875 -5.59375 1.171875 -5.671875 C 1.3125 -6.09375 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.375 -5.65625 3.375 -4.828125 C 3.375 -4.03125 2.9375 -3.34375 2.375 -2.734375 L 0.46875 -0.59375 C 0.359375 -0.484375 0.296875 -0.375 0.296875 0 L 4.359375 0 L 4.6875 -2 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285010-0-5\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.75 -1.828125 C 4.75 -2.65625 3.921875 -3.5625 2.890625 -3.78125 L 2.890625 -3.515625 C 3.703125 -3.78125 4.484375 -4.609375 4.484375 -5.390625 C 4.484375 -6.203125 3.40625 -6.90625 2.453125 -6.90625 C 1.453125 -6.90625 0.484375 -6.171875 0.484375 -5.40625 C 0.484375 -5.078125 0.90625 -4.765625 1.203125 -4.765625 C 1.5 -4.765625 1.90625 -5.109375 1.90625 -5.40625 C 1.90625 -5.90625 1.234375 -6.046875 1.359375 -6.046875 C 1.53125 -6.296875 2.046875 -6.390625 2.40625 -6.390625 C 2.828125 -6.390625 3.171875 -6.296875 3.171875 -5.40625 C 3.171875 -5.28125 3.203125 -4.8125 2.953125 -4.359375 C 2.65625 -3.890625 2.453125 -3.890625 2.203125 -3.890625 C 2.125 -3.875 1.890625 -3.859375 1.8125 -3.859375 C 1.734375 -3.84375 1.46875 -3.703125 1.46875 -3.59375 C 1.46875 -3.484375 1.734375 -3.359375 1.90625 -3.359375 L 2.34375 -3.359375 C 3.15625 -3.359375 3.328125 -2.8125 3.328125 -1.828125 C 3.328125 -0.484375 2.84375 -0.328125 2.40625 -0.328125 C 1.96875 -0.328125 1.359375 -0.453125 1.171875 -0.765625 C 1.21875 -0.765625 1.734375 -1.109375 1.734375 -1.5 C 1.734375 -1.859375 1.265625 -2.1875 0.984375 -2.1875 C 0.734375 -2.1875 0.21875 -1.90625 0.21875 -1.46875 C 0.21875 -0.5625 1.34375 0.21875 2.4375 0.21875 C 3.65625 0.21875 4.75 -0.8125 4.75 -1.828125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285010-0-6\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.890625 -1.78125 L 4.890625 -2.21875 L 3.890625 -2.21875 L 3.890625 -6.625 C 3.890625 -6.8125 3.703125 -7.015625 3.53125 -7.015625 C 3.453125 -7.015625 3.28125 -6.984375 3.203125 -6.859375 L 0.078125 -2.09375 L 0.078125 -1.640625 L 2.734375 -1.640625 L 2.734375 -0.90625 C 2.734375 -0.546875 2.90625 -0.578125 2.171875 -0.578125 L 1.765625 -0.578125 L 1.765625 0.015625 C 2.375 -0.03125 2.890625 -0.03125 3.3125 -0.03125 C 3.734375 -0.03125 4.25 -0.03125 4.859375 0.015625 L 4.859375 -0.578125 L 4.453125 -0.578125 C 3.71875 -0.578125 3.890625 -0.546875 3.890625 -0.90625 L 3.890625 -1.640625 L 4.890625 -1.640625 Z M 2.984375 -2.21875 L 0.84375 -2.21875 L 3.125 -5.71875 L 2.796875 -5.796875 L 2.796875 -2.21875 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,100%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -6.009563 -6.010438 L -22.013469 -22.010438 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,100%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193657 1.594406 C -1.096985 0.995012 -0.000405021 0.0972951 0.300672 0.000616603 C -0.000406428 -0.101582 -1.094237 -0.996521 -1.19368 -1.593152 \" transform=\"matrix(-0.70709,0.7071,0.7071,0.70709,12.14576,28.65024)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,100%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285010-0-1\" x=\"23.504\" y=\"28.625\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.00175 -6.838563 L -0.00175 -77.690125 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195097 1.595906 C -1.097441 0.994344 0.000215 0.0998125 0.29709 -0.00175 C 0.000215 -0.0994063 -1.097441 -0.997844 -1.195097 -1.5955 \" transform=\"matrix(0,1,1,0,34.158,84.32791)\"/>\n",
       "<g style=\"fill:rgb(0%,100%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285010-0-2\" x=\"37.677\" y=\"75.184\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.3455 -35.182313 L -28.3455 -49.287781 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195831 1.59505 C -1.094269 0.997394 -0.00051875 0.0989563 0.300263 0.0013 C -0.00051875 -0.100262 -1.094269 -0.994794 -1.195831 -1.59245 \" transform=\"matrix(0,1,1,0,5.8112,55.9263)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -22.337688 -62.70575 L -6.333781 -78.70575 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,100%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.19557 1.594392 C -1.096127 0.997761 0.000465107 0.10006 0.298781 0.000623493 C 0.000466513 -0.0988172 -1.096113 -0.996534 -1.195548 -1.593166 \" transform=\"matrix(0.70709,0.7071,0.7071,-0.70709,27.82345,85.34386)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285010-0-3\" x=\"31.667\" y=\"9.955\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285010-0-4\" x=\"3.321\" y=\"38.302\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285010-0-5\" x=\"3.321\" y=\"66.539\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285010-0-6\" x=\"31.667\" y=\"95.049\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"1\\\" [],\\n2/\\\"2\\\" [],\\n3/\\\"3\\\" [],\\n4/\\\"4\\\" [],\\n;\\n1 -> [green,edge label={x},blue,] 2;\\n1 -> [green,edge label={y},] 4;\\n2 -> [green,] 3;\\n3 -> [green,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, edge_labels=Dict((1,2)=>\"x\", (1,4)=>\"y\"), edge_style=\"green\", edge_styles=Dict((1,2)=>\"blue\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Layouts"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can use different layouts (currently just Layered [default], Spring, and SimpleNecklace are supported)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"39.969pt\" height=\"98.37pt\" viewBox=\"0 0 39.969 98.37\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285011-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285011-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.375 -0.125 L 4.375 -0.578125 L 3.859375 -0.578125 C 2.953125 -0.578125 3.125 -0.546875 3.125 -0.921875 L 3.125 -6.515625 C 3.125 -6.75 2.9375 -6.90625 2.59375 -6.90625 C 1.9375 -6.234375 1.203125 -6.265625 0.6875 -6.265625 L 0.6875 -5.6875 C 1.09375 -5.6875 1.8125 -5.734375 2 -5.828125 L 2 -0.921875 C 2 -0.5625 2.15625 -0.578125 1.265625 -0.578125 L 0.75 -0.578125 L 0.75 0.015625 C 1.296875 -0.03125 2.15625 -0.03125 2.5625 -0.03125 C 2.953125 -0.03125 3.828125 -0.03125 4.375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285011-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.46875 -2 L 4.03125 -2 C 3.984375 -1.640625 3.96875 -1.21875 3.875 -1.078125 C 3.796875 -1 3.28125 -1.03125 3.0625 -1.03125 L 1.640625 -1.03125 L 2.46875 -1.828125 C 4.015625 -3.203125 4.671875 -3.84375 4.671875 -4.828125 C 4.671875 -5.96875 3.578125 -6.90625 2.359375 -6.90625 C 1.234375 -6.90625 0.296875 -5.859375 0.296875 -4.96875 C 0.296875 -4.40625 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.75 -4.53125 1.75 -4.9375 C 1.75 -5.1875 1.359375 -5.59375 1.015625 -5.59375 C 0.9375 -5.59375 0.921875 -5.59375 1.171875 -5.671875 C 1.3125 -6.09375 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.375 -5.65625 3.375 -4.828125 C 3.375 -4.03125 2.9375 -3.34375 2.375 -2.734375 L 0.46875 -0.59375 C 0.359375 -0.484375 0.296875 -0.375 0.296875 0 L 4.359375 0 L 4.6875 -2 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285011-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.75 -1.828125 C 4.75 -2.65625 3.921875 -3.5625 2.890625 -3.78125 L 2.890625 -3.515625 C 3.703125 -3.78125 4.484375 -4.609375 4.484375 -5.390625 C 4.484375 -6.203125 3.40625 -6.90625 2.453125 -6.90625 C 1.453125 -6.90625 0.484375 -6.171875 0.484375 -5.40625 C 0.484375 -5.078125 0.90625 -4.765625 1.203125 -4.765625 C 1.5 -4.765625 1.90625 -5.109375 1.90625 -5.40625 C 1.90625 -5.90625 1.234375 -6.046875 1.359375 -6.046875 C 1.53125 -6.296875 2.046875 -6.390625 2.40625 -6.390625 C 2.828125 -6.390625 3.171875 -6.296875 3.171875 -5.40625 C 3.171875 -5.28125 3.203125 -4.8125 2.953125 -4.359375 C 2.65625 -3.890625 2.453125 -3.890625 2.203125 -3.890625 C 2.125 -3.875 1.890625 -3.859375 1.8125 -3.859375 C 1.734375 -3.84375 1.46875 -3.703125 1.46875 -3.59375 C 1.46875 -3.484375 1.734375 -3.359375 1.90625 -3.359375 L 2.34375 -3.359375 C 3.15625 -3.359375 3.328125 -2.8125 3.328125 -1.828125 C 3.328125 -0.484375 2.84375 -0.328125 2.40625 -0.328125 C 1.96875 -0.328125 1.359375 -0.453125 1.171875 -0.765625 C 1.21875 -0.765625 1.734375 -1.109375 1.734375 -1.5 C 1.734375 -1.859375 1.265625 -2.1875 0.984375 -2.1875 C 0.734375 -2.1875 0.21875 -1.90625 0.21875 -1.46875 C 0.21875 -0.5625 1.34375 0.21875 2.4375 0.21875 C 3.65625 0.21875 4.75 -0.8125 4.75 -1.828125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285011-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.890625 -1.78125 L 4.890625 -2.21875 L 3.890625 -2.21875 L 3.890625 -6.625 C 3.890625 -6.8125 3.703125 -7.015625 3.53125 -7.015625 C 3.453125 -7.015625 3.28125 -6.984375 3.203125 -6.859375 L 0.078125 -2.09375 L 0.078125 -1.640625 L 2.734375 -1.640625 L 2.734375 -0.90625 C 2.734375 -0.546875 2.90625 -0.578125 2.171875 -0.578125 L 1.765625 -0.578125 L 1.765625 0.015625 C 2.375 -0.03125 2.890625 -0.03125 3.3125 -0.03125 C 3.734375 -0.03125 4.25 -0.03125 4.859375 0.015625 L 4.859375 -0.578125 L 4.453125 -0.578125 C 3.71875 -0.578125 3.890625 -0.546875 3.890625 -0.90625 L 3.890625 -1.640625 L 4.890625 -1.640625 Z M 2.984375 -2.21875 L 0.84375 -2.21875 L 3.125 -5.71875 L 2.796875 -5.796875 L 2.796875 -2.21875 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -6.009563 -6.010438 L -22.013469 -22.010438 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193657 1.594406 C -1.096985 0.995012 -0.000405021 0.0972951 0.300672 0.000616603 C -0.000406428 -0.101582 -1.094237 -0.996521 -1.19368 -1.593152 \" transform=\"matrix(-0.70709,0.7071,0.7071,0.70709,12.14576,28.65024)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.00175 -6.838563 L -0.00175 -77.690125 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195097 1.595906 C -1.097441 0.994344 0.000215 0.0998125 0.29709 -0.00175 C 0.000215 -0.0994063 -1.097441 -0.997844 -1.195097 -1.5955 \" transform=\"matrix(0,1,1,0,34.158,84.32791)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -28.3455 -35.182313 L -28.3455 -49.287781 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195831 1.59505 C -1.094269 0.997394 -0.00051875 0.0989563 0.300263 0.0013 C -0.00051875 -0.100262 -1.094269 -0.994794 -1.195831 -1.59245 \" transform=\"matrix(0,1,1,0,5.8112,55.9263)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -22.337688 -62.70575 L -6.333781 -78.70575 \" transform=\"matrix(1,0,0,-1,34.158,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.19557 1.594392 C -1.096127 0.997761 0.000465107 0.10006 0.298781 0.000623493 C 0.000466513 -0.0988172 -1.096113 -0.996534 -1.195548 -1.593166 \" transform=\"matrix(0.70709,0.7071,0.7071,-0.70709,27.82345,85.34386)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285011-0-1\" x=\"31.667\" y=\"9.955\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285011-0-2\" x=\"3.321\" y=\"38.302\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285011-0-3\" x=\"3.321\" y=\"66.539\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285011-0-4\" x=\"31.667\" y=\"95.049\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"1\\\" [],\\n2/\\\"2\\\" [],\\n3/\\\"3\\\" [],\\n4/\\\"4\\\" [],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, Layouts.Layered())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"52.99pt\" height=\"54.668pt\" viewBox=\"0 0 52.99 54.668\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285012-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285012-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.375 -0.125 L 4.375 -0.578125 L 3.859375 -0.578125 C 2.953125 -0.578125 3.125 -0.546875 3.125 -0.921875 L 3.125 -6.515625 C 3.125 -6.75 2.9375 -6.90625 2.59375 -6.90625 C 1.9375 -6.234375 1.203125 -6.265625 0.6875 -6.265625 L 0.6875 -5.6875 C 1.09375 -5.6875 1.8125 -5.734375 2 -5.828125 L 2 -0.921875 C 2 -0.5625 2.15625 -0.578125 1.265625 -0.578125 L 0.75 -0.578125 L 0.75 0.015625 C 1.296875 -0.03125 2.15625 -0.03125 2.5625 -0.03125 C 2.953125 -0.03125 3.828125 -0.03125 4.375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285012-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.46875 -2 L 4.03125 -2 C 3.984375 -1.640625 3.96875 -1.21875 3.875 -1.078125 C 3.796875 -1 3.28125 -1.03125 3.0625 -1.03125 L 1.640625 -1.03125 L 2.46875 -1.828125 C 4.015625 -3.203125 4.671875 -3.84375 4.671875 -4.828125 C 4.671875 -5.96875 3.578125 -6.90625 2.359375 -6.90625 C 1.234375 -6.90625 0.296875 -5.859375 0.296875 -4.96875 C 0.296875 -4.40625 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.75 -4.53125 1.75 -4.9375 C 1.75 -5.1875 1.359375 -5.59375 1.015625 -5.59375 C 0.9375 -5.59375 0.921875 -5.59375 1.171875 -5.671875 C 1.3125 -6.09375 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.375 -5.65625 3.375 -4.828125 C 3.375 -4.03125 2.9375 -3.34375 2.375 -2.734375 L 0.46875 -0.59375 C 0.359375 -0.484375 0.296875 -0.375 0.296875 0 L 4.359375 0 L 4.6875 -2 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285012-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.75 -1.828125 C 4.75 -2.65625 3.921875 -3.5625 2.890625 -3.78125 L 2.890625 -3.515625 C 3.703125 -3.78125 4.484375 -4.609375 4.484375 -5.390625 C 4.484375 -6.203125 3.40625 -6.90625 2.453125 -6.90625 C 1.453125 -6.90625 0.484375 -6.171875 0.484375 -5.40625 C 0.484375 -5.078125 0.90625 -4.765625 1.203125 -4.765625 C 1.5 -4.765625 1.90625 -5.109375 1.90625 -5.40625 C 1.90625 -5.90625 1.234375 -6.046875 1.359375 -6.046875 C 1.53125 -6.296875 2.046875 -6.390625 2.40625 -6.390625 C 2.828125 -6.390625 3.171875 -6.296875 3.171875 -5.40625 C 3.171875 -5.28125 3.203125 -4.8125 2.953125 -4.359375 C 2.65625 -3.890625 2.453125 -3.890625 2.203125 -3.890625 C 2.125 -3.875 1.890625 -3.859375 1.8125 -3.859375 C 1.734375 -3.84375 1.46875 -3.703125 1.46875 -3.59375 C 1.46875 -3.484375 1.734375 -3.359375 1.90625 -3.359375 L 2.34375 -3.359375 C 3.15625 -3.359375 3.328125 -2.8125 3.328125 -1.828125 C 3.328125 -0.484375 2.84375 -0.328125 2.40625 -0.328125 C 1.96875 -0.328125 1.359375 -0.453125 1.171875 -0.765625 C 1.21875 -0.765625 1.734375 -1.109375 1.734375 -1.5 C 1.734375 -1.859375 1.265625 -2.1875 0.984375 -2.1875 C 0.734375 -2.1875 0.21875 -1.90625 0.21875 -1.46875 C 0.21875 -0.5625 1.34375 0.21875 2.4375 0.21875 C 3.65625 0.21875 4.75 -0.8125 4.75 -1.828125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285012-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.890625 -1.78125 L 4.890625 -2.21875 L 3.890625 -2.21875 L 3.890625 -6.625 C 3.890625 -6.8125 3.703125 -7.015625 3.53125 -7.015625 C 3.453125 -7.015625 3.28125 -6.984375 3.203125 -6.859375 L 0.078125 -2.09375 L 0.078125 -1.640625 L 2.734375 -1.640625 L 2.734375 -0.90625 C 2.734375 -0.546875 2.90625 -0.578125 2.171875 -0.578125 L 1.765625 -0.578125 L 1.765625 0.015625 C 2.375 -0.03125 2.890625 -0.03125 3.3125 -0.03125 C 3.734375 -0.03125 4.25 -0.03125 4.859375 0.015625 L 4.859375 -0.578125 L 4.453125 -0.578125 C 3.71875 -0.578125 3.890625 -0.546875 3.890625 -0.90625 L 3.890625 -1.640625 L 4.890625 -1.640625 Z M 2.984375 -2.21875 L 0.84375 -2.21875 L 3.125 -5.71875 L 2.796875 -5.796875 L 2.796875 -2.21875 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 0.0006875 -6.837219 L 0.0006875 -33.872375 \" transform=\"matrix(1,0,0,-1,47.179,6.862)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195148 1.594437 C -1.097491 0.996781 0.000165 0.0983437 0.29704 0.0006875 C 0.000165 -0.100875 -1.097491 -0.995406 -1.195148 -1.593063 \" transform=\"matrix(0,1,1,0,47.179,40.73421)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -6.011031 0.0260625 L -34.436813 0.14325 \" transform=\"matrix(1,0,0,-1,47.179,6.862)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.19521 1.592458 C -1.095081 0.995216 -0.00153691 0.101306 0.29966 0.000990591 C -0.000712156 -0.0979092 -1.094646 -0.996969 -1.193733 -1.595036 \" transform=\"matrix(-1,-0.00414,-0.00414,1,12.74107,6.719)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -6.011031 -41.130187 L -34.89775 -40.938781 \" transform=\"matrix(1,0,0,-1,47.179,6.862)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195645 1.592866 C -1.094091 0.995873 0.00159878 0.100684 0.299124 0.00106453 C -0.00100646 -0.0985516 -1.096706 -0.996331 -1.194362 -1.594625 \" transform=\"matrix(-1,-0.00653,-0.00653,1,12.2796,47.80167)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -41.288375 -33.9505 L -40.987594 -7.180969 \" transform=\"matrix(1,0,0,-1,47.179,6.862)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.194108 1.594351 C -1.097566 0.997748 -0.00149908 0.0998444 0.300399 0.00166431 C 0.000736097 -0.0993592 -1.094744 -0.994508 -1.197405 -1.593346 \" transform=\"matrix(0.01122,-0.99995,-0.99995,-0.01122,6.1897,14.04259)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285012-0-1\" x=\"44.688\" y=\"10.18\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285012-0-2\" x=\"44.688\" y=\"51.347\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285012-0-3\" x=\"3.321\" y=\"50.967\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285012-0-4\" x=\"3.782\" y=\"10.065\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [spring layout, random seed = 42] {\\n1/\\\"1\\\" [],\\n2/\\\"2\\\" [],\\n3/\\\"3\\\" [],\\n4/\\\"4\\\" [],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{force}\", true, true)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, Layouts.Spring())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can set the random seed for the Spring layout."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"52.587pt\" height=\"54.478pt\" viewBox=\"0 0 52.587 54.478\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285013-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285013-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.375 -0.125 L 4.375 -0.578125 L 3.859375 -0.578125 C 2.953125 -0.578125 3.125 -0.546875 3.125 -0.921875 L 3.125 -6.515625 C 3.125 -6.75 2.9375 -6.90625 2.59375 -6.90625 C 1.9375 -6.234375 1.203125 -6.265625 0.6875 -6.265625 L 0.6875 -5.6875 C 1.09375 -5.6875 1.8125 -5.734375 2 -5.828125 L 2 -0.921875 C 2 -0.5625 2.15625 -0.578125 1.265625 -0.578125 L 0.75 -0.578125 L 0.75 0.015625 C 1.296875 -0.03125 2.15625 -0.03125 2.5625 -0.03125 C 2.953125 -0.03125 3.828125 -0.03125 4.375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285013-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.46875 -2 L 4.03125 -2 C 3.984375 -1.640625 3.96875 -1.21875 3.875 -1.078125 C 3.796875 -1 3.28125 -1.03125 3.0625 -1.03125 L 1.640625 -1.03125 L 2.46875 -1.828125 C 4.015625 -3.203125 4.671875 -3.84375 4.671875 -4.828125 C 4.671875 -5.96875 3.578125 -6.90625 2.359375 -6.90625 C 1.234375 -6.90625 0.296875 -5.859375 0.296875 -4.96875 C 0.296875 -4.40625 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.75 -4.53125 1.75 -4.9375 C 1.75 -5.1875 1.359375 -5.59375 1.015625 -5.59375 C 0.9375 -5.59375 0.921875 -5.59375 1.171875 -5.671875 C 1.3125 -6.09375 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.375 -5.65625 3.375 -4.828125 C 3.375 -4.03125 2.9375 -3.34375 2.375 -2.734375 L 0.46875 -0.59375 C 0.359375 -0.484375 0.296875 -0.375 0.296875 0 L 4.359375 0 L 4.6875 -2 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285013-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.75 -1.828125 C 4.75 -2.65625 3.921875 -3.5625 2.890625 -3.78125 L 2.890625 -3.515625 C 3.703125 -3.78125 4.484375 -4.609375 4.484375 -5.390625 C 4.484375 -6.203125 3.40625 -6.90625 2.453125 -6.90625 C 1.453125 -6.90625 0.484375 -6.171875 0.484375 -5.40625 C 0.484375 -5.078125 0.90625 -4.765625 1.203125 -4.765625 C 1.5 -4.765625 1.90625 -5.109375 1.90625 -5.40625 C 1.90625 -5.90625 1.234375 -6.046875 1.359375 -6.046875 C 1.53125 -6.296875 2.046875 -6.390625 2.40625 -6.390625 C 2.828125 -6.390625 3.171875 -6.296875 3.171875 -5.40625 C 3.171875 -5.28125 3.203125 -4.8125 2.953125 -4.359375 C 2.65625 -3.890625 2.453125 -3.890625 2.203125 -3.890625 C 2.125 -3.875 1.890625 -3.859375 1.8125 -3.859375 C 1.734375 -3.84375 1.46875 -3.703125 1.46875 -3.59375 C 1.46875 -3.484375 1.734375 -3.359375 1.90625 -3.359375 L 2.34375 -3.359375 C 3.15625 -3.359375 3.328125 -2.8125 3.328125 -1.828125 C 3.328125 -0.484375 2.84375 -0.328125 2.40625 -0.328125 C 1.96875 -0.328125 1.359375 -0.453125 1.171875 -0.765625 C 1.21875 -0.765625 1.734375 -1.109375 1.734375 -1.5 C 1.734375 -1.859375 1.265625 -2.1875 0.984375 -2.1875 C 0.734375 -2.1875 0.21875 -1.90625 0.21875 -1.46875 C 0.21875 -0.5625 1.34375 0.21875 2.4375 0.21875 C 3.65625 0.21875 4.75 -0.8125 4.75 -1.828125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285013-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.890625 -1.78125 L 4.890625 -2.21875 L 3.890625 -2.21875 L 3.890625 -6.625 C 3.890625 -6.8125 3.703125 -7.015625 3.53125 -7.015625 C 3.453125 -7.015625 3.28125 -6.984375 3.203125 -6.859375 L 0.078125 -2.09375 L 0.078125 -1.640625 L 2.734375 -1.640625 L 2.734375 -0.90625 C 2.734375 -0.546875 2.90625 -0.578125 2.171875 -0.578125 L 1.765625 -0.578125 L 1.765625 0.015625 C 2.375 -0.03125 2.890625 -0.03125 3.3125 -0.03125 C 3.734375 -0.03125 4.25 -0.03125 4.859375 0.015625 L 4.859375 -0.578125 L 4.453125 -0.578125 C 3.71875 -0.578125 3.890625 -0.546875 3.890625 -0.90625 L 3.890625 -1.640625 L 4.890625 -1.640625 Z M 2.984375 -2.21875 L 0.84375 -2.21875 L 3.125 -5.71875 L 2.796875 -5.796875 L 2.796875 -2.21875 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 0.0015 -6.838562 L 0.0015 -33.889344 \" transform=\"matrix(1,0,0,-1,5.811,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.197039 1.59525 C -1.095476 0.997594 -0.00172625 0.0991563 0.299055 0.0015 C -0.00172625 -0.100062 -1.095476 -0.994594 -1.197039 -1.59225 \" transform=\"matrix(0,1,1,0,5.811,40.52907)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 6.009313 -0.0221562 L 34.431188 -0.135437 \" transform=\"matrix(1,0,0,-1,5.811,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.194323 1.595401 C -1.094349 0.998133 -0.00102062 0.100031 0.30015 -0.000362917 C -0.000247663 -0.0991847 -1.094417 -0.997961 -1.193674 -1.592096 \" transform=\"matrix(1,0.00388,0.00388,-1,40.24282,6.77191)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 6.009313 -41.1745 L 34.497594 -41.108094 \" transform=\"matrix(1,0,0,-1,5.811,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.194061 1.592061 C -1.097753 0.998092 0.00177317 0.101065 0.298416 -0.00117115 C 0.00132094 -0.098153 -1.094472 -0.998009 -1.19739 -1.595432 \" transform=\"matrix(1,-0.00227,-0.00227,-1,40.30705,47.7456)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 40.954625 -34.147156 L 40.911656 -7.510437 \" transform=\"matrix(1,0,0,-1,5.811,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193726 1.59221 C -1.097002 0.994403 -0.000744369 0.0981612 0.299884 0.0000359313 C -0.00105515 -0.101057 -1.096204 -0.997786 -1.194792 -1.595289 \" transform=\"matrix(-0.00156,-1,-1,0.00156,46.72316,14.14754)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285013-0-1\" x=\"3.321\" y=\"9.956\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285013-0-2\" x=\"3.321\" y=\"51.142\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285013-0-3\" x=\"44.285\" y=\"50.938\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285013-0-4\" x=\"44.221\" y=\"10.169\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [spring layout, random seed = 52] {\\n1/\\\"1\\\" [],\\n2/\\\"2\\\" [],\\n3/\\\"3\\\" [],\\n4/\\\"4\\\" [],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{force}\", true, true)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, Layouts.Spring(randomSeed=52))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"47.714pt\" height=\"49.478pt\" viewBox=\"0 0 47.714 49.478\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285014-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285014-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.375 -0.125 L 4.375 -0.578125 L 3.859375 -0.578125 C 2.953125 -0.578125 3.125 -0.546875 3.125 -0.921875 L 3.125 -6.515625 C 3.125 -6.75 2.9375 -6.90625 2.59375 -6.90625 C 1.9375 -6.234375 1.203125 -6.265625 0.6875 -6.265625 L 0.6875 -5.6875 C 1.09375 -5.6875 1.8125 -5.734375 2 -5.828125 L 2 -0.921875 C 2 -0.5625 2.15625 -0.578125 1.265625 -0.578125 L 0.75 -0.578125 L 0.75 0.015625 C 1.296875 -0.03125 2.15625 -0.03125 2.5625 -0.03125 C 2.953125 -0.03125 3.828125 -0.03125 4.375 0.015625 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285014-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.46875 -2 L 4.03125 -2 C 3.984375 -1.640625 3.96875 -1.21875 3.875 -1.078125 C 3.796875 -1 3.28125 -1.03125 3.0625 -1.03125 L 1.640625 -1.03125 L 2.46875 -1.828125 C 4.015625 -3.203125 4.671875 -3.84375 4.671875 -4.828125 C 4.671875 -5.96875 3.578125 -6.90625 2.359375 -6.90625 C 1.234375 -6.90625 0.296875 -5.859375 0.296875 -4.96875 C 0.296875 -4.40625 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.75 -4.53125 1.75 -4.9375 C 1.75 -5.1875 1.359375 -5.59375 1.015625 -5.59375 C 0.9375 -5.59375 0.921875 -5.59375 1.171875 -5.671875 C 1.3125 -6.09375 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.375 -5.65625 3.375 -4.828125 C 3.375 -4.03125 2.9375 -3.34375 2.375 -2.734375 L 0.46875 -0.59375 C 0.359375 -0.484375 0.296875 -0.375 0.296875 0 L 4.359375 0 L 4.6875 -2 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285014-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.75 -1.828125 C 4.75 -2.65625 3.921875 -3.5625 2.890625 -3.78125 L 2.890625 -3.515625 C 3.703125 -3.78125 4.484375 -4.609375 4.484375 -5.390625 C 4.484375 -6.203125 3.40625 -6.90625 2.453125 -6.90625 C 1.453125 -6.90625 0.484375 -6.171875 0.484375 -5.40625 C 0.484375 -5.078125 0.90625 -4.765625 1.203125 -4.765625 C 1.5 -4.765625 1.90625 -5.109375 1.90625 -5.40625 C 1.90625 -5.90625 1.234375 -6.046875 1.359375 -6.046875 C 1.53125 -6.296875 2.046875 -6.390625 2.40625 -6.390625 C 2.828125 -6.390625 3.171875 -6.296875 3.171875 -5.40625 C 3.171875 -5.28125 3.203125 -4.8125 2.953125 -4.359375 C 2.65625 -3.890625 2.453125 -3.890625 2.203125 -3.890625 C 2.125 -3.875 1.890625 -3.859375 1.8125 -3.859375 C 1.734375 -3.84375 1.46875 -3.703125 1.46875 -3.59375 C 1.46875 -3.484375 1.734375 -3.359375 1.90625 -3.359375 L 2.34375 -3.359375 C 3.15625 -3.359375 3.328125 -2.8125 3.328125 -1.828125 C 3.328125 -0.484375 2.84375 -0.328125 2.40625 -0.328125 C 1.96875 -0.328125 1.359375 -0.453125 1.171875 -0.765625 C 1.21875 -0.765625 1.734375 -1.109375 1.734375 -1.5 C 1.734375 -1.859375 1.265625 -2.1875 0.984375 -2.1875 C 0.734375 -2.1875 0.21875 -1.90625 0.21875 -1.46875 C 0.21875 -0.5625 1.34375 0.21875 2.4375 0.21875 C 3.65625 0.21875 4.75 -0.8125 4.75 -1.828125 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285014-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 4.890625 -1.78125 L 4.890625 -2.21875 L 3.890625 -2.21875 L 3.890625 -6.625 C 3.890625 -6.8125 3.703125 -7.015625 3.53125 -7.015625 C 3.453125 -7.015625 3.28125 -6.984375 3.203125 -6.859375 L 0.078125 -2.09375 L 0.078125 -1.640625 L 2.734375 -1.640625 L 2.734375 -0.90625 C 2.734375 -0.546875 2.90625 -0.578125 2.171875 -0.578125 L 1.765625 -0.578125 L 1.765625 0.015625 C 2.375 -0.03125 2.890625 -0.03125 3.3125 -0.03125 C 3.734375 -0.03125 4.25 -0.03125 4.859375 0.015625 L 4.859375 -0.578125 L 4.453125 -0.578125 C 3.71875 -0.578125 3.890625 -0.546875 3.890625 -0.90625 L 3.890625 -1.640625 L 4.890625 -1.640625 Z M 2.984375 -2.21875 L 0.84375 -2.21875 L 3.125 -5.71875 L 2.796875 -5.796875 L 2.796875 -2.21875 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -6.009344 -6.010437 L -11.712469 -11.709656 \" transform=\"matrix(1,0,0,-1,23.857,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193983 1.594561 C -1.097311 0.995167 0.00203102 0.100212 0.300346 0.000771287 C -0.000732585 -0.101427 -1.094563 -0.996367 -1.194006 -1.592997 \" transform=\"matrix(-0.70709,0.7071,0.7071,0.70709,12.14542,18.34958)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 6.010187 -6.010437 L 11.713312 -11.709656 \" transform=\"matrix(1,0,0,-1,23.857,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193381 1.593594 C -1.093938 0.996963 -0.000107673 0.102024 0.300971 -0.000174651 C 0.00265593 -0.0996153 -1.096686 -0.99457 -1.193358 -1.593964 \" transform=\"matrix(0.70709,0.7071,0.7071,-0.70709,35.56856,18.34956)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -12.036688 -24.057312 L -6.333563 -29.756531 \" transform=\"matrix(1,0,0,-1,23.857,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.196135 1.595305 C -1.093938 0.995911 -0.00012038 0.100956 0.298195 0.00151554 C -0.000121786 -0.0979209 -1.096714 -0.995622 -1.196157 -1.592253 \" transform=\"matrix(0.7071,0.70709,0.70709,-0.7071,17.52245,36.39569)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M 6.010187 -30.08075 L 11.713312 -24.381531 \" transform=\"matrix(1,0,0,-1,23.857,6.638)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195369 1.591953 C -1.095935 0.995321 0.000645052 0.0976045 0.29896 -0.0018362 C 0.000643646 -0.101273 -1.093187 -0.996212 -1.195392 -1.595605 \" transform=\"matrix(0.70709,-0.7071,-0.7071,-0.70709,35.56856,31.01869)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285014-0-1\" x=\"21.366\" y=\"9.956\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285014-0-2\" x=\"3.321\" y=\"28.002\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285014-0-3\" x=\"21.366\" y=\"45.938\"/>\n",
       "</g>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285014-0-4\" x=\"39.412\" y=\"28.057\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [simple necklace layout, ] {\\n1/\\\"1\\\" [],\\n2/\\\"2\\\" [],\\n3/\\\"3\\\" [],\\n4/\\\"4\\\" [],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{circular}\", true, true)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, Layouts.SimpleNecklace())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Options"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"73.444pt\" height=\"190.838pt\" viewBox=\"0 0 73.444 190.838\" version=\"1.1\">\n",
       "<defs>\n",
       "<g>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285015-0-0\">\n",
       "<path style=\"stroke:none;\" d=\"\"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285015-0-1\">\n",
       "<path style=\"stroke:none;\" d=\"M 8.421875 0 L 8.421875 -1.203125 L 5.984375 -1.203125 L 5.984375 -13.875 L 5.375 -13.875 C 4.25 -12.71875 3.0625 -12.5625 1.59375 -12.515625 L 1.59375 -11.296875 C 2.328125 -11.34375 3.3125 -11.375 4.125 -11.75 L 4.125 -1.203125 L 1.6875 -1.203125 L 1.6875 0 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285015-0-2\">\n",
       "<path style=\"stroke:none;\" d=\"M 8.84375 0 L 8.84375 -1.40625 L 5.203125 -1.40625 C 4.953125 -1.40625 4.703125 -1.390625 4.46875 -1.390625 L 2.515625 -1.390625 L 2.515625 -1.453125 L 5.40625 -4.375 C 5.984375 -4.984375 6.859375 -5.703125 7.453125 -6.421875 C 8.03125 -7.125 8.84375 -8.125 8.84375 -9.5625 C 8.84375 -11.84375 7.1875 -13.875 4.578125 -13.875 C 2.546875 -13.875 1.21875 -12.71875 0.640625 -10.65625 L 1.671875 -9.234375 C 2.1875 -11.359375 2.703125 -12.5625 4.3125 -12.5625 C 6.09375 -12.5625 6.9375 -11.109375 6.9375 -9.515625 C 6.9375 -7.625 5.53125 -6.15625 4.4375 -5.0625 L 0.828125 -1.28125 L 0.828125 0 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285015-0-3\">\n",
       "<path style=\"stroke:none;\" d=\"M 9 -3.796875 C 9 -5.4375 7.75 -6.796875 6.265625 -7.296875 C 7.515625 -8 8.46875 -9.28125 8.46875 -10.765625 C 8.46875 -12.5 6.75 -13.875 4.8125 -13.875 C 3.03125 -13.875 1.515625 -12.90625 0.90625 -11.6875 C 1.109375 -11.40625 1.484375 -10.796875 1.8125 -10.25 C 2.359375 -11.71875 3.40625 -12.625 4.796875 -12.625 C 5.953125 -12.625 6.5625 -11.859375 6.5625 -10.765625 C 6.5625 -9.625 5.984375 -8.390625 4.765625 -8.09375 C 4.6875 -8.09375 3.40625 -7.96875 3.09375 -7.9375 L 3.09375 -6.6875 L 4.640625 -6.6875 C 6.59375 -6.6875 7 -5 7 -3.828125 C 7 -2.203125 6.234375 -0.953125 4.75 -0.953125 C 3.59375 -0.953125 2.046875 -1.53125 0.921875 -3.359375 C 0.75 -2.453125 0.75 -2.421875 0.640625 -1.859375 C 1.671875 -0.375 3.34375 0.328125 4.796875 0.328125 C 7.140625 0.328125 9 -1.625 9 -3.796875 Z \"/>\n",
       "</symbol>\n",
       "<symbol overflow=\"visible\" id=\"glyph-1517795316285015-0-4\">\n",
       "<path style=\"stroke:none;\" d=\"M 9.28125 -3.53125 L 9.28125 -4.796875 L 7.390625 -4.796875 L 7.390625 -13.546875 L 5.34375 -13.546875 L 0.390625 -4.703125 L 0.390625 -3.53125 L 5.5 -3.53125 L 5.5 0 L 7.390625 0 L 7.390625 -3.53125 Z M 5.703125 -4.796875 L 2.203125 -4.796875 C 3.40625 -6.90625 5.796875 -11.15625 5.828125 -12.59375 L 5.5625 -12.59375 L 5.5625 -4.796875 Z \"/>\n",
       "</symbol>\n",
       "</g>\n",
       "</defs>\n",
       "<g id=\"surface1\">\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -16.751594 -16.752844 L -39.618781 -39.620031 \" transform=\"matrix(1,0,0,-1,65.068,10.462)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.194562 1.594671 C -1.095128 0.998039 0.00145207 0.100322 0.299767 0.000881778 C 0.00145066 -0.0985547 -1.095142 -0.996256 -1.194585 -1.592887 \" transform=\"matrix(-0.70709,0.7071,0.7071,0.70709,25.44962,50.08038)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -0.00159375 -20.924719 L -0.00159375 -149.026281 \" transform=\"matrix(1,0,0,-1,65.068,10.462)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.197151 1.592156 C -1.095589 0.9945 -0.00183875 0.0999688 0.298942 -0.00159375 C -0.00183875 -0.09925 -1.095589 -0.997687 -1.197151 -1.595344 \" transform=\"matrix(0,1,1,0,65.068,159.49012)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -56.693 -77.620031 L -56.693 -91.674719 \" transform=\"matrix(1,0,0,-1,65.068,10.462)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.193904 1.59437 C -1.096248 0.996714 0.00140875 0.0982763 0.298284 0.00062 C 0.00140875 -0.100942 -1.096248 -0.995474 -1.193904 -1.59313 \" transform=\"matrix(0,1,1,0,8.37438,102.13531)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -39.943 -130.139562 L -17.075812 -153.00675 \" transform=\"matrix(1,0,0,-1,65.068,10.462)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.31879;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -1.195677 1.592545 C -1.096234 0.995915 0.000358168 0.0982135 0.298675 -0.00122297 C 0.000359574 -0.100664 -1.09622 -0.99838 -1.195655 -1.595012 \" transform=\"matrix(0.70709,0.7071,0.7071,-0.70709,47.9928,163.46763)\"/>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -8.177375 -10.264562 L 8.178094 -10.264562 L 8.178094 10.262781 L -8.177375 10.262781 Z \" transform=\"matrix(1,0,0,-1,65.068,10.462)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285015-0-1\" x=\"60.213\" y=\"17.405\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -8.175781 -10.262969 L 8.175781 -10.262969 L 8.175781 10.264375 L -8.175781 10.264375 Z \" transform=\"matrix(1,0,0,-1,8.375,67.155)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285015-0-2\" x=\"3.52\" y=\"74.098\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -8.175781 -10.429344 L 8.175781 -10.429344 L 8.175781 10.430031 L -8.175781 10.430031 Z \" transform=\"matrix(1,0,0,-1,8.375,123.848)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285015-0-3\" x=\"3.52\" y=\"130.625\"/>\n",
       "</g>\n",
       "<path style=\"fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;\" d=\"M -8.177375 -10.099625 L 8.178094 -10.099625 L 8.178094 10.099594 L -8.177375 10.099594 Z \" transform=\"matrix(1,0,0,-1,65.068,180.541)\"/>\n",
       "<g style=\"fill:rgb(0%,0%,0%);fill-opacity:1;\">\n",
       "  <use xlink:href=\"#glyph-1517795316285015-0-4\" x=\"60.213\" y=\"187.318\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n",
       "\n"
      ],
      "text/plain": [
       "TikzPictures.TikzPicture(\"\\\\graph [layered layout, ] {\\n1/\\\"1\\\" [draw],\\n2/\\\"2\\\" [draw],\\n3/\\\"3\\\" [draw],\\n4/\\\"4\\\" [draw],\\n;\\n1 -> [,] 2;\\n1 -> [,] 4;\\n2 -> [,] 3;\\n3 -> [,] 4;\\n};\\n\", \"scale=2, font=\\\\huge\\\\sf\", \"\\\\usepackage{fontspec}\\r\\n\\\\setmainfont{Latin Modern Math}\\r\\n\\\\usetikzlibrary{graphs}\\r\\n\\\\usetikzlibrary{graphdrawing}\\r\\n\\n\\\\usegdlibrary{layered}\", true, true)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "TikzGraphs.plot(g, node_style=\"draw\", options=\"scale=2, font=\\\\huge\\\\sf\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Future Plans"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Gradually, more functionality from pgf/tikz will be migrated into this package."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Julia 0.6.0",
   "language": "julia",
   "name": "julia-0.6"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "0.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
